Created
February 19, 2019 16:30
-
-
Save rgov/4daa69aee9c57ccc2ac96354a7d08cfc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Redefine add_test to set the LLVM_PROFILE_FILE environment variable | |
| # on each test | |
| function(add_test) | |
| _add_test(${ARGN}) | |
| # There are two signatures to the add_test function to handle | |
| if(ARGV0 STREQUAL "NAME") | |
| set(TEST_NAME "${ARGV1}") | |
| else() | |
| set(TEST_NAME "${ARGV0}") | |
| endif() | |
| # Set the environment on the test | |
| set_tests_properties( | |
| "${TEST_NAME}" | |
| PROPERTIES ENVIRONMENT | |
| "LLVM_PROFILE_FILE=${PROJECT_BINARY_DIR}/coverage/cov-%m.profraw" | |
| ) | |
| endfunction(add_test) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment