Skip to content

Commit abb9efc

Browse files
committed
added make targets check and test to CMake
1 parent 9c7fcc0 commit abb9efc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ if (BUILD_TESTS)
5959
DEPENDS cppcheck validateCFG)
6060
endif()
6161

62+
add_custom_target(test $<TARGET_FILE:testrunner>
63+
DEPENDS cppcheck testrunner)
64+
65+
add_custom_target(check $<TARGET_FILE:testrunner> -q
66+
DEPENDS cppcheck testrunner)
67+
6268
if (REGISTER_TESTS)
6369
# CMP0064 requires 3.4
6470
# CMAKE_MATCH_<n> usage for if (MATCHES) requires 3.9
@@ -80,7 +86,7 @@ if (BUILD_TESTS)
8086
if (${NAME} IN_LIST SKIP_TESTS)
8187
elseif(TEST ${NAME})
8288
else()
83-
add_test(NAME ${NAME} COMMAND testrunner ${NAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
89+
add_test(NAME ${NAME} COMMAND $<TARGET_FILE:testrunner> ${NAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
8490
endif()
8591
endfunction()
8692

0 commit comments

Comments
 (0)