##// END OF EJS Templates
Add the coverage target whith the test. make coverage will call the code...
perrinel -
r44:31b8fb9583a3
parent child
Show More
@@ -69,8 +69,9 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 )
75
76
76 # Add to the list of sources files all the sources in the same
77 # Add to the list of sources files all the sources in the same
@@ -88,12 +89,20 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})
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 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
107 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
99 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
108 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
General Comments 0
You need to be logged in to leave comments. Login now