summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-01-27 16:32:52 (GMT)
committerBrad King <brad.king@kitware.com>2024-01-27 16:34:35 (GMT)
commitc5b58b0842925b7de0e36dfb30cfc47383f4d5c6 (patch)
tree029edca28dd8c5badc81d0e9d5b60f223ce77a45
parentb440e0af3f2b5bcc12ed38c499102532250aa4be (diff)
downloadCMake-c5b58b0842925b7de0e36dfb30cfc47383f4d5c6.zip
CMake-c5b58b0842925b7de0e36dfb30cfc47383f4d5c6.tar.gz
CMake-c5b58b0842925b7de0e36dfb30cfc47383f4d5c6.tar.bz2
Tests: Improve RunCMake.add_test error formatting
-rw-r--r--Tests/RunCMake/add_test/TestLauncher-check.cmake20
1 files changed, 13 insertions, 7 deletions
diff --git a/Tests/RunCMake/add_test/TestLauncher-check.cmake b/Tests/RunCMake/add_test/TestLauncher-check.cmake
index 78020a6..d6e795c 100644
--- a/Tests/RunCMake/add_test/TestLauncher-check.cmake
+++ b/Tests/RunCMake/add_test/TestLauncher-check.cmake
@@ -2,27 +2,33 @@ set(testfile "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake")
if(EXISTS "${testfile}")
file(READ "${testfile}" testfile_contents)
else()
- message(FATAL_ERROR "Could not find expected CTestTestfile.cmake.")
+ set(RunCMake_TEST_FAILED "Could not find expected CTestTestfile.cmake.")
+ return()
endif()
-set(error_details "There is a problem with generated test file: ${testfile}")
+set(error_details "There is a problem with generated test file:\n ${testfile}")
if(testfile_contents MATCHES "add_test[(]DoesNotUseTestLauncher [^\n]+pseudo_test_launcher[^\n]+\n")
- message(SEND_ERROR "Used test launcher when it should not be used. ${error_details}")
+ set(RunCMake_TEST_FAILED "Used test launcher when it should not be used. ${error_details}")
+ return()
endif()
if(NOT testfile_contents MATCHES "add_test[(]UsesTestLauncher [^\n]+pseudo_test_launcher[^\n]+\n")
- message(SEND_ERROR "Did not use test launcher when it should be used. ${error_details}")
+ set(RunCMake_TEST_FAILED "Did not use test launcher when it should be used. ${error_details}")
+ return()
endif()
if(testfile_contents MATCHES "add_test[(]DoesNotUseTestLauncherWithGenex [^\n]+pseudo_test_launcher[^\n]+\n")
- message(SEND_ERROR "Used test launcher when it should not be used. ${error_details}")
+ set(RunCMake_TEST_FAILED "Used test launcher when it should not be used. ${error_details}")
+ return()
endif()
if(NOT testfile_contents MATCHES "add_test[(]UsesTestLauncherWithExecTargetFromSubdirAddedWithoutGenex [^\n]+pseudo_test_launcher[^\n]+\n")
- message(SEND_ERROR "Did not use test launcher when it should be used. ${error_details}")
+ set(RunCMake_TEST_FAILED "Did not use test launcher when it should be used. ${error_details}")
+ return()
endif()
if(testfile_contents MATCHES "add_test[(]DoesNotUseTestLauncherWithExecTargetFromSubdirAddedWithGenex [^\n]+pseudo_test_launcher[^\n]+\n")
- message(SEND_ERROR "Used test launcher when it should not be used. ${error_details}")
+ set(RunCMake_TEST_FAILED "Used test launcher when it should not be used. ${error_details}")
+ return()
endif()