From 7c722dca5f7d67ce81c5d3fa497a912f4e9cb08f Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Fri, 17 Feb 2017 13:59:26 +0100 Subject: [PATCH] CMake: Add target "check" that builds and runs tests --- tests/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c372127..27d6900 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -29,6 +29,11 @@ if(ENABLE_CJSON_TEST) endif() endif() + #"check" target that automatically builds everything and runs the tests + add_custom_target(check + COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure + DEPENDS ${unity_tests}) + foreach(unity_test ${unity_tests}) add_executable("${unity_test}" "${unity_test}.c") target_link_libraries("${unity_test}" "${CJSON_LIB}" unity test-common) -- GitLab