Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ test-unit: update-test-discovery CMakeLists.txt
@cd unit-build; cmake \
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$(PWD)/unit-build \
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO=$(PWD)/unit-build \
-DSENTRY_BACKEND=none \
-DSENTRY_BACKEND=$(or $(SENTRY_BACKEND),none) \
$(if $(SENTRY_TRANSPORT),-DSENTRY_TRANSPORT=$(SENTRY_TRANSPORT)) \
..
@cmake --build unit-build --target sentry_test_unit --parallel --config RelWithDebInfo
./unit-build/sentry_test_unit
Expand All @@ -39,7 +40,8 @@ test-leaks: update-test-discovery CMakeLists.txt
@mkdir -p leak-build
@cd leak-build; cmake \
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$(PWD)/leak-build \
-DSENTRY_BACKEND=none \
-DSENTRY_BACKEND=$(or $(SENTRY_BACKEND),none) \
$(if $(SENTRY_TRANSPORT),-DSENTRY_TRANSPORT=$(SENTRY_TRANSPORT)) \
-DWITH_ASAN_OPTION=ON \
-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang \
-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++ \
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ target_compile_definitions(sentry PRIVATE SIZEOF_LONG=${CMAKE_SIZEOF_LONG})

target_compile_definitions(sentry_test_unit PRIVATE SENTRY_UNITTEST)

foreach(handler crashpad::handler sentry-crash)
if(TARGET ${handler})
add_custom_command(TARGET sentry_test_unit POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:${handler}>" "$<TARGET_FILE_DIR:sentry_test_unit>"
VERBATIM)
endif()
endforeach()
Comment thread
jpnurmi marked this conversation as resolved.

option(SENTRY_CTEST_INDIVIDUAL "Register sentry unit tests as individual tests instead of a single binary" ON)

if(SENTRY_CTEST_INDIVIDUAL)
Expand All @@ -119,10 +127,12 @@ if(SENTRY_CTEST_INDIVIDUAL)
message(WARNING "Failed to extract test name from line: ${line}")
else()
add_test(NAME sentry/${CMAKE_MATCH_1} COMMAND sentry_test_unit --no-summary ${CMAKE_MATCH_1})
set_tests_properties(sentry/${CMAKE_MATCH_1} PROPERTIES RUN_SERIAL TRUE)
endif()
endforeach()
else()
add_test(NAME sentry/unit-tests COMMAND sentry_test_unit)
set_tests_properties(sentry/unit-tests PROPERTIES RUN_SERIAL TRUE)
endif()

add_executable(sentry_fuzz_json
Expand Down
Loading