##// END OF EJS Templates
Merge pull request 136 from SCIQLOP-Initialisation feature/GCovAsScript...
perrinel -
r46:b7525153deb1 merge
parent child
Show More
@@ -102,7 +102,7 IF(BUILD_TESTS)
102 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
102 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
103
103
104 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
104 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
105 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} gcov)
105 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES})
106 qt5_use_modules(${testName} Test)
106 qt5_use_modules(${testName} Test)
107
107
108 ADD_TEST( NAME ${testName} COMMAND ${testName} )
108 ADD_TEST( NAME ${testName} COMMAND ${testName} )
@@ -69,6 +69,7 IF(BUILD_TESTS)
69 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
69 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
70 SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
70 SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
71
71
72 SET(TARGETS_COV)
72 FOREACH( testFile ${TESTS_SOURCES} )
73 FOREACH( testFile ${TESTS_SOURCES} )
73 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
74 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
74 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
75 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
@@ -88,13 +89,21 IF(BUILD_TESTS)
88 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
89 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
89 qt5_use_modules(${testName} Test)
90 qt5_use_modules(${testName} Test)
90
91
91 ADD_TEST( NAME ${testName} COMMAND ${testDirectory} )
92 ADD_TEST( NAME ${testName} COMMAND ${testName} )
92
93
93 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
94 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
94 set(Coverage_NAME ${testName})
95 set(Coverage_NAME ${testName})
95 SETUP_TARGET_FOR_COVERAGE(TARGET ${testName}_coverage OUTPUT ${testFile}-path NAME ${testFile} EXECUTABLE ${testName})
96 SETUP_TARGET_FOR_COVERAGE(TARGET ${testName}_coverage OUTPUT ${testFile}-path NAME ${testFile} EXECUTABLE ${testName})
97 LIST( APPEND TARGETS_COV ${testName}_coverage)
98
96 ENDFOREACH( testFile )
99 ENDFOREACH( testFile )
97
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 )
106
98 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
107 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
99 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
108 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
100 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
109 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
General Comments 0
You need to be logged in to leave comments. Login now