@@ -102,7 +102,7 IF(BUILD_TESTS) | |||
|
102 | 102 | LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS}) |
|
103 | 103 | |
|
104 | 104 | ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources}) |
|
105 |
TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} |
|
|
105 | TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES}) | |
|
106 | 106 | qt5_use_modules(${testName} Test) |
|
107 | 107 | |
|
108 | 108 | ADD_TEST( NAME ${testName} COMMAND ${testName} ) |
@@ -69,8 +69,9 IF(BUILD_TESTS) | |||
|
69 | 69 | FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h) |
|
70 | 70 | SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME}) |
|
71 | 71 | |
|
72 | SET(TARGETS_COV) | |
|
72 | 73 | FOREACH( testFile ${TESTS_SOURCES} ) |
|
73 |
|
|
|
74 | GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY ) | |
|
74 | 75 | GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE ) |
|
75 | 76 | |
|
76 | 77 | # Add to the list of sources files all the sources in the same |
@@ -88,12 +89,20 IF(BUILD_TESTS) | |||
|
88 | 89 | TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} ) |
|
89 | 90 | qt5_use_modules(${testName} Test) |
|
90 | 91 | |
|
91 |
ADD_TEST( NAME ${testName} COMMAND ${test |
|
|
92 | ADD_TEST( NAME ${testName} COMMAND ${testName} ) | |
|
92 | 93 | |
|
93 | 94 | SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES}) |
|
94 | 95 | set(Coverage_NAME ${testName}) |
|
95 | 96 | SETUP_TARGET_FOR_COVERAGE(TARGET ${testName}_coverage OUTPUT ${testFile}-path NAME ${testFile} EXECUTABLE ${testName}) |
|
96 | ENDFOREACH( testFile ) | |
|
97 | LIST( APPEND TARGETS_COV ${testName}_coverage) | |
|
98 | ||
|
99 | ENDFOREACH( testFile ) | |
|
100 | ||
|
101 | add_custom_target(coverage) | |
|
102 | ||
|
103 | FOREACH( target_cov ${TARGETS_COV} ) | |
|
104 | add_custom_command(TARGET coverage PRE_BUILD COMMAND make ${target_cov}) | |
|
105 | ENDFOREACH( target_cov ) | |
|
97 | 106 | |
|
98 | 107 | LIST(APPEND testFilesToFormat ${TESTS_SOURCES}) |
|
99 | 108 | LIST(APPEND testFilesToFormat ${TESTS_HEADERS}) |
General Comments 0
You need to be logged in to leave comments.
Login now