Set profiling environment variable when tests are run.

This has no effect most of the time, but if the runtime is built with
llvm-cov support, then this will cause each test to emit a .profraw
file, which can be merged with:

$ llvm-profdata merge -sparse Test/*.profraw -o libobjc.profdata

This can then be used to generate coverage reports from the test suite
and find code paths that are not currently being tested.
main
David Chisnall 8 years ago
parent c865b519b0
commit 29a35ab8ba

@ -81,7 +81,7 @@ function(addtest_flags TEST_NAME FLAGS TEST_SOURCE)
LINKER_LANGUAGE C
)
set_property(TEST ${TEST_NAME} PROPERTY
ENVIRONMENT "LD_LIBRARY_PATH="
ENVIRONMENT "LD_LIBRARY_PATH=" "LLVM_PROFILE_FILE=${TEST_NAME}.profraw"
)
target_link_libraries(${TEST_NAME} objc)
endfunction(addtest_flags)

Loading…
Cancel
Save