Skip to content

Commit

Permalink
GHI #32 Set LLVM_PROFILE_FILE for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
doodspav committed Jul 13, 2024
1 parent d7aae6c commit 60be1a8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/cmake/CreateTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,16 @@ function(_create_test)
WORKING_DIRECTORY "${test_working_dir}"
)

# when compiling with LLVM, use unique name for each test's coverage file
# otherwise they will all have the same name and overwrite each other
# since the variable is prefixed with LLVM, no harm in always setting it
foreach(test IN LISTS added_tests)
string(MAKE_C_IDENTIFIER "${test}" safe_test_name)
set_tests_properties("${test}" PROPERTIES
ENVIRONMENT "LLVM_PROFILE_FILE=${safe_test_name}.profraw"
)
endforeach()

# add label to tests so ctest can run them by kind
foreach(test IN LISTS added_tests)
set_property(
Expand Down

0 comments on commit 60be1a8

Please sign in to comment.