summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-03-06 18:22:01 (GMT)
committerBrad King <brad.king@kitware.com>2024-03-06 21:14:04 (GMT)
commitca0a9def2e95ed92ce866faa3c70015b9ab6123d (patch)
tree01e5982c89f5ba3b80b5e4b93d6ce25978d04fd7 /Tests
parent60433fc6e82267011ff8cb62feb7611c696c87c0 (diff)
downloadCMake-ca0a9def2e95ed92ce866faa3c70015b9ab6123d.zip
CMake-ca0a9def2e95ed92ce866faa3c70015b9ab6123d.tar.gz
CMake-ca0a9def2e95ed92ce866faa3c70015b9ab6123d.tar.bz2
ctest: Exit with failure when tests-from-file input is missing
If the options added by * commit 022f20f663 (ctest: add command line option to run the tests listed in a given file, 2023-11-29, v3.29.0-rc1~66^2~2) * commit dbacc1d5a8 (ctest: add command line option to exclude tests listed in a given file, 2023-11-30, v3.29.0-rc1~66^2~1) * commit 701029726f (ctest_test: add options INCLUDE_FROM_FILE and EXCLUDE_FROM_FILE, 2023-12-03, v3.29.0-rc1~66^2) are given a missing file, fail instead of ignoring it. Fixes: #25740
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-missing-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-missing-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-missing-stdout.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-include-missing-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-include-missing-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-include-missing-stdout.txt2
-rw-r--r--Tests/RunCMake/ctest_test/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-exclude-missing-result.txt1
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-exclude-missing-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-exclude-missing-stdout.txt2
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-include-missing-result.txt1
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-include-missing-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-include-missing-stdout.txt2
14 files changed, 24 insertions, 0 deletions
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index e4a92ad..715a5fa 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -223,6 +223,8 @@ add_test(Test11 \"${CMAKE_COMMAND}\" -E echo \"test11\")
endfunction()
run_TestsFromFileTest(include --tests-from-file ${RunCMake_SOURCE_DIR}/TestsFromFile-TestList.txt)
run_TestsFromFileTest(exclude --exclude-from-file ${RunCMake_SOURCE_DIR}/TestsFromFile-TestList.txt)
+run_TestsFromFileTest(include-missing --tests-from-file ${RunCMake_SOURCE_DIR}/TestsFromFile-TestList-missing.txt)
+run_TestsFromFileTest(exclude-missing --exclude-from-file ${RunCMake_SOURCE_DIR}/TestsFromFile-TestList-missing.txt)
function(run_SerialFailed)
diff --git a/Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-missing-result.txt b/Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-missing-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-missing-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-missing-stderr.txt b/Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-missing-stderr.txt
new file mode 100644
index 0000000..1d22abc
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-missing-stderr.txt
@@ -0,0 +1,2 @@
+Problem reading test list file: [^
+]*/Tests/RunCMake/CTestCommandLine/TestsFromFile-TestList-missing\.txt while generating list of tests to run\.
diff --git a/Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-missing-stdout.txt b/Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-missing-stdout.txt
new file mode 100644
index 0000000..1e4e805
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-missing-stdout.txt
@@ -0,0 +1,2 @@
+Test project [^
+]*/Tests/RunCMake/CTestCommandLine/TestsFromFile$
diff --git a/Tests/RunCMake/CTestCommandLine/TestsFromFile-include-missing-result.txt b/Tests/RunCMake/CTestCommandLine/TestsFromFile-include-missing-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/TestsFromFile-include-missing-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/CTestCommandLine/TestsFromFile-include-missing-stderr.txt b/Tests/RunCMake/CTestCommandLine/TestsFromFile-include-missing-stderr.txt
new file mode 100644
index 0000000..1d22abc
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/TestsFromFile-include-missing-stderr.txt
@@ -0,0 +1,2 @@
+Problem reading test list file: [^
+]*/Tests/RunCMake/CTestCommandLine/TestsFromFile-TestList-missing\.txt while generating list of tests to run\.
diff --git a/Tests/RunCMake/CTestCommandLine/TestsFromFile-include-missing-stdout.txt b/Tests/RunCMake/CTestCommandLine/TestsFromFile-include-missing-stdout.txt
new file mode 100644
index 0000000..1e4e805
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/TestsFromFile-include-missing-stdout.txt
@@ -0,0 +1,2 @@
+Test project [^
+]*/Tests/RunCMake/CTestCommandLine/TestsFromFile$
diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
index d4250c4..e2c41a0 100644
--- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
@@ -177,6 +177,8 @@ add_test(NAME Test11 COMMAND ${CMAKE_COMMAND} -E true)
endfunction()
run_tests_from_file(include INCLUDE_FROM_FILE ${RunCMake_SOURCE_DIR}/TestsFromFile-TestList.txt)
run_tests_from_file(exclude EXCLUDE_FROM_FILE ${RunCMake_SOURCE_DIR}/TestsFromFile-TestList.txt)
+run_tests_from_file(include-missing INCLUDE_FROM_FILE ${RunCMake_SOURCE_DIR}/TestsFromFile-TestList-missing.txt)
+run_tests_from_file(exclude-missing EXCLUDE_FROM_FILE ${RunCMake_SOURCE_DIR}/TestsFromFile-TestList-missing.txt)
# Make sure environment gets logged
diff --git a/Tests/RunCMake/ctest_test/TestsFromFile-exclude-missing-result.txt b/Tests/RunCMake/ctest_test/TestsFromFile-exclude-missing-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestsFromFile-exclude-missing-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_test/TestsFromFile-exclude-missing-stderr.txt b/Tests/RunCMake/ctest_test/TestsFromFile-exclude-missing-stderr.txt
new file mode 100644
index 0000000..a5b3e46
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestsFromFile-exclude-missing-stderr.txt
@@ -0,0 +1,2 @@
+Problem reading test list file: [^
+]*/Tests/RunCMake/ctest_test/TestsFromFile-TestList-missing\.txt while generating list of tests to run\.
diff --git a/Tests/RunCMake/ctest_test/TestsFromFile-exclude-missing-stdout.txt b/Tests/RunCMake/ctest_test/TestsFromFile-exclude-missing-stdout.txt
new file mode 100644
index 0000000..ac5a727
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestsFromFile-exclude-missing-stdout.txt
@@ -0,0 +1,2 @@
+Test project [^
+]*/Tests/RunCMake/ctest_test/TestsFromFile-exclude-missing-build$
diff --git a/Tests/RunCMake/ctest_test/TestsFromFile-include-missing-result.txt b/Tests/RunCMake/ctest_test/TestsFromFile-include-missing-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestsFromFile-include-missing-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_test/TestsFromFile-include-missing-stderr.txt b/Tests/RunCMake/ctest_test/TestsFromFile-include-missing-stderr.txt
new file mode 100644
index 0000000..a5b3e46
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestsFromFile-include-missing-stderr.txt
@@ -0,0 +1,2 @@
+Problem reading test list file: [^
+]*/Tests/RunCMake/ctest_test/TestsFromFile-TestList-missing\.txt while generating list of tests to run\.
diff --git a/Tests/RunCMake/ctest_test/TestsFromFile-include-missing-stdout.txt b/Tests/RunCMake/ctest_test/TestsFromFile-include-missing-stdout.txt
new file mode 100644
index 0000000..4a9447c
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestsFromFile-include-missing-stdout.txt
@@ -0,0 +1,2 @@
+Test project [^
+]*/Tests/RunCMake/ctest_test/TestsFromFile-include-missing-build$