diff options
-rw-r--r-- | CMakeLists.txt | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 13f67280..d6c5841f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,10 +59,11 @@ if(BUILD_TESTING) require_test(CppUnit) file(GLOB_RECURSE testing_sources test/*.cpp) - add_executable(test/usdx-test ${testing_sources} $<TARGET_OBJECTS:objects>) - target_link_libraries(test/usdx-test ${LIBS} ${TEST_LIBS}) + add_executable(usdx-test ${testing_sources} $<TARGET_OBJECTS:objects>) + target_link_libraries(usdx-test ${LIBS} ${TEST_LIBS}) + add_test(NAME test - COMMAND test/test + COMMAND usdx-test WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/test/" ) endif() @@ -72,13 +73,12 @@ endif() # set(coverage-dir "${PROJECT_SOURCE_DIR}/test/coverage") -add_executable(test/usdx-test-coverage EXCLUDE_FROM_ALL +add_executable(usdx-test-coverage EXCLUDE_FROM_ALL ${testing_sources} ${sources}) -target_link_libraries(test/usdx-test-coverage ${LIBS} ${TEST_LIBS} "-coverage") -set_target_properties(test/usdx-test-coverage +target_link_libraries(usdx-test-coverage ${LIBS} ${TEST_LIBS} "-coverage") +set_target_properties(usdx-test-coverage PROPERTIES COMPILE_FLAGS "${debug} -fprofile-arcs -ftest-coverage") -get_property(coverage-binary TARGET test/usdx-test-coverage PROPERTY LOCATION) add_custom_target(test-coverage WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/test/" # prepare coverage checks COMMAND rm -f .error @@ -86,7 +86,7 @@ add_custom_target(test-coverage WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/test/" COMMAND lcov --directory "${PROJECT_SOURCE_DIR}" --zerocounters # running checks and save result for later use - COMMAND sh -c \"${coverage-binary} || touch .error\" + COMMAND sh -c \"$<TARGET_FILE:usdx-test-coverage> || touch .error\" # building coverage pages COMMAND lcov --directory "${PROJECT_SOURCE_DIR}" --capture --output-file "${coverage-dir}/coverage.info.tmp" |