From 6fc8038b4e3d2c2e3bd771fa6bdcc1b833ceae47 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Fri, 30 Jul 2021 19:07:17 -0500 Subject: [PATCH] Prefix all ninja/cmake test target names with test_ `test:foo` is not allowed by CMake ("reserved name") and `test/foo` won't work since CMake doesn't allow targets to have a directory separator in their name. --- cmake/Tests.cmake | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cmake/Tests.cmake b/cmake/Tests.cmake index a86fcbd3c..4af559bc1 100644 --- a/cmake/Tests.cmake +++ b/cmake/Tests.cmake @@ -97,6 +97,14 @@ configure_file(build_tools/pexpect_helper.py pexpect_helper.py COPYONLY) # your binaries actually being built before `make test` is executed (requiring `make all` first), # and the only dependency a test can have is on another test. So we make building fish and # `fish_tests` prerequisites to our entire top-level `test` target. +function(add_test_target NAME) + add_custom_target("test_${NAME}" + COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -R "^${NAME}$$" + DEPENDS fish_tests tests_buildroot_target + USES_TERMINAL + ) +endfunction() + add_custom_target(tests_buildroot_target # Make the directory in which to run tests: COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_INSTALL_DIR} @@ -111,14 +119,6 @@ add_custom_target(tests_buildroot_target ${TEST_ROOT_DIR} DEPENDS fish fish_test_helper) -function(add_test_target NAME) - add_custom_target(${NAME} - COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -R "^${NAME}$$" - DEPENDS fish_tests tests_buildroot_target - USES_TERMINAL - ) -endfunction() - foreach(LTEST ${LOW_LEVEL_TESTS}) add_test( NAME ${LTEST}