summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-01-17 14:17:52 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-01-17 14:18:04 (GMT)
commitdd18be5ebf6486486a272f47df3318d1db3a03cc (patch)
treeabb3a3469eba5704c5a458c30f1485731f91028d /Tests
parent99c6e032d65b74281ca80079f71c28e171579e01 (diff)
parent0661de58d845f537d070979f9b49dd05800a141e (diff)
downloadCMake-dd18be5ebf6486486a272f47df3318d1db3a03cc.zip
CMake-dd18be5ebf6486486a272f47df3318d1db3a03cc.tar.gz
CMake-dd18be5ebf6486486a272f47df3318d1db3a03cc.tar.bz2
Merge topic 'ctest-no-tests-action-env-var'
0661de58d8 ctest(1): Add CTEST_NO_TESTS_ACTION env var Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8044
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/CTestCommandLine/no-tests_env_bad-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/no-tests_env_bad-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/no-tests_env_bad_with_cli_error-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/no-tests_env_bad_with_cli_error-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/no-tests_env_empty_legacy-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/no-tests_env_error-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/no-tests_env_error-stderr.txt1
-rw-r--r--Tests/RunCMake/RunCTest.cmake1
9 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index 8c35fe5..bda260a 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -389,6 +389,14 @@ function(run_NoTests)
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})
+
+ run_cmake_command(no-tests_env_ignore ${CMAKE_COMMAND} -E env CTEST_NO_TESTS_ACTION=ignore ${CMAKE_CTEST_COMMAND})
+ run_cmake_command(no-tests_env_error ${CMAKE_COMMAND} -E env CTEST_NO_TESTS_ACTION=error ${CMAKE_CTEST_COMMAND})
+ run_cmake_command(no-tests_env_bad ${CMAKE_COMMAND} -E env CTEST_NO_TESTS_ACTION=bad ${CMAKE_CTEST_COMMAND})
+ run_cmake_command(no-tests_env_empty_legacy ${CMAKE_COMMAND} -E env CTEST_NO_TESTS_ACTION= ${CMAKE_CTEST_COMMAND})
+
+ run_cmake_command(no-tests_env_bad_with_cli_error ${CMAKE_COMMAND} -E env CTEST_NO_TESTS_ACTION=bad ${CMAKE_CTEST_COMMAND} --no-tests=error)
+
file(WRITE "${RunCMake_TEST_BINARY_DIR}/NoTestsScript.cmake" "
set(CTEST_COMMAND \"${CMAKE_CTEST_COMMAND}\")
set(CTEST_SOURCE_DIRECTORY \"${RunCMake_SOURCE_DIR}\")
diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_env_bad-result.txt b/Tests/RunCMake/CTestCommandLine/no-tests_env_bad-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/no-tests_env_bad-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_env_bad-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests_env_bad-stderr.txt
new file mode 100644
index 0000000..97187e6
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/no-tests_env_bad-stderr.txt
@@ -0,0 +1 @@
+^Unknown value for CTEST_NO_TESTS_ACTION: 'bad'$
diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_env_bad_with_cli_error-result.txt b/Tests/RunCMake/CTestCommandLine/no-tests_env_bad_with_cli_error-result.txt
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/no-tests_env_bad_with_cli_error-result.txt
@@ -0,0 +1 @@
+8
diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_env_bad_with_cli_error-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests_env_bad_with_cli_error-stderr.txt
new file mode 100644
index 0000000..eafba1c
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/no-tests_env_bad_with_cli_error-stderr.txt
@@ -0,0 +1 @@
+No tests were found!!!
diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_env_empty_legacy-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests_env_empty_legacy-stderr.txt
new file mode 100644
index 0000000..a7c4b11
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/no-tests_env_empty_legacy-stderr.txt
@@ -0,0 +1 @@
+^No tests were found!!!$
diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_env_error-result.txt b/Tests/RunCMake/CTestCommandLine/no-tests_env_error-result.txt
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/no-tests_env_error-result.txt
@@ -0,0 +1 @@
+8
diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_env_error-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests_env_error-stderr.txt
new file mode 100644
index 0000000..eafba1c
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/no-tests_env_error-stderr.txt
@@ -0,0 +1 @@
+No tests were found!!!
diff --git a/Tests/RunCMake/RunCTest.cmake b/Tests/RunCMake/RunCTest.cmake
index 86f5b3a..d46f6ad 100644
--- a/Tests/RunCMake/RunCTest.cmake
+++ b/Tests/RunCMake/RunCTest.cmake
@@ -3,6 +3,7 @@ include(RunCMake)
# Isolate our ctest runs from external environment.
unset(ENV{CTEST_PARALLEL_LEVEL})
unset(ENV{CTEST_OUTPUT_ON_FAILURE})
+unset(ENV{CTEST_NO_TESTS_ACTION})
function(run_ctest CASE_NAME)
configure_file(${RunCMake_SOURCE_DIR}/test.cmake.in