Skip to content

Commit

Permalink
Uploading crash logs reliably
Browse files Browse the repository at this point in the history
  • Loading branch information
gershnik committed Aug 27, 2024
1 parent 1183c5d commit 873a17d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ jobs:
run: cmake --build build --config $BUILD_TYPE --target test-jnigen

- name: Upload JDK crashes
if: always() && matrix.os == 'windows-latest'
if: failure() && matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
if-no-files-found: ignore
name: JNI_Crash_Logs
name: JNI_Crash_Logs_${{ matrix }}
path: |
tests/build/hs_*.log
tests/build/hs_*.mdmp
Expand Down
8 changes: 7 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,15 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL Android)

else()

if (Java_VERSION VERSION_GREATER_EQUAL 9)

set(SMJNITEST_JAVA_ARGS "-XX:+CreateCoredumpOnCrash")

endif()

add_custom_target(test-native ALL
DEPENDS javabuild smjnitests
COMMAND ${Java_JAVA_EXECUTABLE} -Djava.library.path=$<TARGET_FILE_DIR:smjnitests> -jar smjnitests.jar
COMMAND ${Java_JAVA_EXECUTABLE} ${SMJNITEST_JAVA_ARGS} -Djava.library.path=$<TARGET_FILE_DIR:smjnitests> -jar smjnitests.jar
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/build
)

Expand Down

0 comments on commit 873a17d

Please sign in to comment.