summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-03-10 14:10:29 (GMT)
committerBrad King <brad.king@kitware.com>2024-03-10 14:26:14 (GMT)
commitae69801d9620eb6b43146d42f04d1a4b6b40e416 (patch)
treec604202e1aa4b3ba7b087e02f4059fe62f75ad84 /Tests
parent30dda4941698f6b9dd292b4237b4eff187c80241 (diff)
downloadCMake-ae69801d9620eb6b43146d42f04d1a4b6b40e416.zip
CMake-ae69801d9620eb6b43146d42f04d1a4b6b40e416.tar.gz
CMake-ae69801d9620eb6b43146d42f04d1a4b6b40e416.tar.bz2
Tests: Convert CTestTestSkipReturnCode to RunCMake.ctest_test case
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt13
-rw-r--r--Tests/CTestTestSkipReturnCode/CMakeLists.txt8
-rw-r--r--Tests/CTestTestSkipReturnCode/CTestConfig.cmake4
-rw-r--r--Tests/CTestTestSkipReturnCode/test.cmake.in23
-rw-r--r--Tests/RunCMake/ctest_test/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/ctest_test/SkipReturnCode-stdout.txt8
6 files changed, 15 insertions, 48 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index ae065c8..0919933 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -3073,19 +3073,6 @@ if(BUILD_TESTING)
"Test command:.*Working Directory:.*Environment variables:.*foo=bar.*this=that"
)
- configure_file(
- "${CMake_SOURCE_DIR}/Tests/CTestTestSkipReturnCode/test.cmake.in"
- "${CMake_BINARY_DIR}/Tests/CTestTestSkipReturnCode/test.cmake"
- @ONLY ESCAPE_QUOTES)
- add_test(CTestTestSkipReturnCode ${CMAKE_CTEST_COMMAND}
- -S "${CMake_BINARY_DIR}/Tests/CTestTestSkipReturnCode/test.cmake" -V
- --output-log "${CMake_BINARY_DIR}/Tests/CTestTestSkipReturnCode/testOutput.log"
- -C \${CTEST_CONFIGURATION_TYPE}
- )
- set_tests_properties(CTestTestSkipReturnCode PROPERTIES
- PASS_REGULAR_EXPRESSION "CMakeV1 \\.* +Passed.*CMakeV2 \\.+\\*+Skipped")
- set_property(TEST CTestTestSkipReturnCode PROPERTY ENVIRONMENT CTEST_PARALLEL_LEVEL=)
-
ADD_TEST_MACRO(CTestTestSerialInDepends ${CMAKE_CTEST_COMMAND} -j 4
--output-on-failure -C "\${CTestTest_CONFIG}")
diff --git a/Tests/CTestTestSkipReturnCode/CMakeLists.txt b/Tests/CTestTestSkipReturnCode/CMakeLists.txt
deleted file mode 100644
index 1eeeec6..0000000
--- a/Tests/CTestTestSkipReturnCode/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-project(CTestTestSkipReturnCode)
-include(CTest)
-
-add_test (NAME CMakeV1 COMMAND ${CMAKE_COMMAND} "--version")
-add_test (NAME CMakeV2 COMMAND ${CMAKE_COMMAND} "--version")
-
-set_tests_properties(CMakeV2 PROPERTIES SKIP_RETURN_CODE 0)
diff --git a/Tests/CTestTestSkipReturnCode/CTestConfig.cmake b/Tests/CTestTestSkipReturnCode/CTestConfig.cmake
deleted file mode 100644
index 5bc1e9e..0000000
--- a/Tests/CTestTestSkipReturnCode/CTestConfig.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "open.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
diff --git a/Tests/CTestTestSkipReturnCode/test.cmake.in b/Tests/CTestTestSkipReturnCode/test.cmake.in
deleted file mode 100644
index b45e4a6..0000000
--- a/Tests/CTestTestSkipReturnCode/test.cmake.in
+++ /dev/null
@@ -1,23 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-# Settings:
-set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
-set(CTEST_SITE "@SITE@")
-set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-SkipReturnCode")
-
-set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestSkipReturnCode")
-set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestSkipReturnCode")
-set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
-set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
-set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@")
-set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
-set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
-set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
-set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
-
-#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
-
-CTEST_START(Experimental)
-CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
-CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
-CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
index 54880b5..012c1a0 100644
--- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
@@ -26,6 +26,13 @@ set_property(TEST test6 PROPERTY DEPENDS test1)
run_ctest_test(SerialOrder INCLUDE test)
unset(CASE_CMAKELISTS_SUFFIX_CODE)
+set(CASE_CMAKELISTS_SUFFIX_CODE [[
+add_test(NAME skip COMMAND ${CMAKE_COMMAND} -E true)
+set_property(TEST skip PROPERTY SKIP_RETURN_CODE 0)
+]])
+run_ctest_test(SkipReturnCode)
+unset(CASE_CMAKELISTS_SUFFIX_CODE)
+
# Tests for the 'Test Load' feature of ctest
#
# Spoof a load average value to make these tests more reliable.
diff --git a/Tests/RunCMake/ctest_test/SkipReturnCode-stdout.txt b/Tests/RunCMake/ctest_test/SkipReturnCode-stdout.txt
new file mode 100644
index 0000000..98e603a
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/SkipReturnCode-stdout.txt
@@ -0,0 +1,8 @@
+Test project [^
+]*/Tests/RunCMake/ctest_test/SkipReturnCode-build
+ Start 1: RunCMakeVersion
+1/2 Test #1: RunCMakeVersion .................. Passed +[0-9.]+ sec
+ Start 2: skip
+2/2 Test #2: skip .............................\*\*\*Skipped +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 2