summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-02-03 18:21:52 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-02-03 18:22:02 (GMT)
commit25bf64eca639dff012f47a74a73d1af2b2e4d9c6 (patch)
tree72d9042d25aa43271e2f62d4394f32e66c1b96aa /Tests
parentdfd7ca0d99b3745950925e585e73864036c0904b (diff)
parenta39d4139d07eee841016ddccde0e7c35d40c894c (diff)
downloadCMake-25bf64eca639dff012f47a74a73d1af2b2e4d9c6.zip
CMake-25bf64eca639dff012f47a74a73d1af2b2e4d9c6.tar.gz
CMake-25bf64eca639dff012f47a74a73d1af2b2e4d9c6.tar.bz2
Merge topic 'ctest-add-ignore-no-tests-option'
a39d4139d0 Add --no-tests=<[error|ignore]> option to CTest Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4258
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake29
-rw-r--r--Tests/RunCMake/CTestCommandLine/no-tests-script_error-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/no-tests-script_error-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/no-tests-script_legacy-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/no-tests-script_legacy-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/no-tests_bad-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/no-tests_bad-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/no-tests_error-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/no-tests_error-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/no-tests_legacy-stderr.txt1
10 files changed, 38 insertions, 0 deletions
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index b2de596..9b9ae65 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -314,5 +314,34 @@ function(run_ShowOnly)
endfunction()
run_ShowOnly()
+function(run_NoTests)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/NoTests)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "")
+ run_cmake_command(no-tests_ignore ${CMAKE_CTEST_COMMAND} --no-tests=ignore)
+ run_cmake_command(no-tests_error ${CMAKE_CTEST_COMMAND} --no-tests=error)
+ run_cmake_command(no-tests_bad ${CMAKE_CTEST_COMMAND} --no-tests=bad)
+ run_cmake_command(no-tests_legacy ${CMAKE_CTEST_COMMAND})
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/NoTestsScript.cmake" "
+ set(CTEST_COMMAND \"${CMAKE_CTEST_COMMAND}\")
+ set(CTEST_SOURCE_DIRECTORY \"${RunCMake_SOURCE_DIR}\")
+ set(CTEST_BINARY_DIRECTORY \"${RunCMake_TEST_BINARY_DIR}\")
+ ctest_start(Experimental)
+ ctest_test()
+")
+ run_cmake_command(
+ no-tests-script_ignore ${CMAKE_CTEST_COMMAND} --no-tests=ignore
+ -S "${RunCMake_TEST_BINARY_DIR}/NoTestsScript.cmake")
+ run_cmake_command(
+ no-tests-script_error ${CMAKE_CTEST_COMMAND} --no-tests=error
+ -S "${RunCMake_TEST_BINARY_DIR}/NoTestsScript.cmake")
+ run_cmake_command(
+ no-tests-script_legacy ${CMAKE_CTEST_COMMAND}
+ -S "${RunCMake_TEST_BINARY_DIR}/NoTestsScript.cmake")
+endfunction()
+run_NoTests()
+
# Check the configuration type variable is passed
run_ctest(check-configuration-type)
diff --git a/Tests/RunCMake/CTestCommandLine/no-tests-script_error-result.txt b/Tests/RunCMake/CTestCommandLine/no-tests-script_error-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/no-tests-script_error-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestCommandLine/no-tests-script_error-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests-script_error-stderr.txt
new file mode 100644
index 0000000..a7c4b11
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/no-tests-script_error-stderr.txt
@@ -0,0 +1 @@
+^No tests were found!!!$
diff --git a/Tests/RunCMake/CTestCommandLine/no-tests-script_legacy-result.txt b/Tests/RunCMake/CTestCommandLine/no-tests-script_legacy-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/no-tests-script_legacy-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestCommandLine/no-tests-script_legacy-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests-script_legacy-stderr.txt
new file mode 100644
index 0000000..a7c4b11
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/no-tests-script_legacy-stderr.txt
@@ -0,0 +1 @@
+^No tests were found!!!$
diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_bad-result.txt b/Tests/RunCMake/CTestCommandLine/no-tests_bad-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/no-tests_bad-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_bad-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests_bad-stderr.txt
new file mode 100644
index 0000000..1703539
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/no-tests_bad-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: '--no-tests=' given unknown value 'bad'$
diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_error-result.txt b/Tests/RunCMake/CTestCommandLine/no-tests_error-result.txt
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/no-tests_error-result.txt
@@ -0,0 +1 @@
+8
diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_error-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests_error-stderr.txt
new file mode 100644
index 0000000..eafba1c
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/no-tests_error-stderr.txt
@@ -0,0 +1 @@
+No tests were found!!!
diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_legacy-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests_legacy-stderr.txt
new file mode 100644
index 0000000..a7c4b11
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/no-tests_legacy-stderr.txt
@@ -0,0 +1 @@
+^No tests were found!!!$