diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ba2bfce..1f5f1291 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: run: cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=-fsanitize=address,undefined,alignment,array-bounds -DCMAKE_EXE_LINKER_FLAGS=-fsanitize=address,undefined,alignment,array-bounds - name: CMake build - run: cmake --build build --parallel --target run_unit_test + run: cmake --build build --parallel --target run-unit-test valgrind: name: "Valgrind" @@ -112,7 +112,7 @@ jobs: run: cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_FLAGS=--coverage -DCMAKE_EXE_LINKER_FLAGS=--coverage - name: CMake build - run: cmake --build build --parallel --target run_unit_test + run: cmake --build build --parallel --target run-unit-test - name: Generate coverage run: | diff --git a/test/exit/CMakeLists.txt b/test/exit/CMakeLists.txt index 65882d80..158cd9fe 100644 --- a/test/exit/CMakeLists.txt +++ b/test/exit/CMakeLists.txt @@ -28,6 +28,6 @@ set_property(TEST error-test-1 PROPERTY WILL_FAIL true) add_test(NAME error-test-2 COMMAND app) set_property(TEST error-test-2 PROPERTY PASS_REGULAR_EXPRESSION "the following arguments are required: positional\nusage: app \\[-h\\] \\[--optional OPTIONAL\\] \\[-v\\] positional\n\npositional arguments:\n positional\n\noptional arguments:\n -h, --help show this help message and exit\n --optional OPTIONAL\n -v, --version show program's version number and exit\n") -add_custom_target(run_exit_test ALL +add_custom_target(run-exit-test ALL COMMAND ${CMAKE_CTEST_COMMAND} -C debug --output-on-failure DEPENDS app) diff --git a/test/unittest/CMakeLists.txt b/test/unittest/CMakeLists.txt index b8763787..844e2a97 100644 --- a/test/unittest/CMakeLists.txt +++ b/test/unittest/CMakeLists.txt @@ -32,7 +32,7 @@ target_compile_options(unittest PRIVATE /W4 /WX /permissive->) target_link_options(unittest PRIVATE $ENV{LINKER_OPTIONS}) -add_test(NAME unittest COMMAND unittest) -add_custom_target(run_unit_test ALL +add_test(NAME unit-test COMMAND unittest) +add_custom_target(run-unit-test ALL COMMAND ${CMAKE_CTEST_COMMAND} -C debug --output-on-failure DEPENDS unittest)