summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Tests/CMakeLists.txt23
-rw-r--r--Tests/CTestTestFailure/CMakeLists.txt8
-rw-r--r--Tests/CTestTestFailure/CTestConfig.cmake4
-rw-r--r--Tests/CTestTestFailure/testNoBuild.cmake.in23
-rw-r--r--Tests/CTestTestFailure/testNoExe.cmake.in21
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/CTestCommandLine/output-junit-stderr.txt3
-rw-r--r--Tests/RunCMake/ctest_build/BuildFailure.cxx (renamed from Tests/CTestTestFailure/badCode.cxx)0
-rw-r--r--Tests/RunCMake/ctest_build/RunCMakeTest.cmake21
-rw-r--r--Tests/RunCMake/ctest_test/NotRun-result.txt1
-rw-r--r--Tests/RunCMake/ctest_test/NotRun-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_test/NotRun-stdout.txt7
-rw-r--r--Tests/RunCMake/ctest_test/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/ctest_test/TestRepeatNotRun-stderr.txt3
-rw-r--r--Tests/RunCMake/ctest_test/TestRepeatNotRun-stdout.txt4
15 files changed, 38 insertions, 94 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index d9fa0e1..7a71c0a 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2765,29 +2765,6 @@ if(BUILD_TESTING)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateP4_DIR}")
endif()
- configure_file(
- "${CMake_SOURCE_DIR}/Tests/CTestTestFailure/testNoBuild.cmake.in"
- "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoBuild.cmake"
- @ONLY ESCAPE_QUOTES)
- add_test(CTestTestNoBuild ${CMAKE_CTEST_COMMAND}
- -S "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoBuild.cmake" -V
- --output-log "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testOut1.log"
- )
- set_tests_properties(CTestTestNoBuild PROPERTIES
- FAIL_REGULAR_EXPRESSION "Error" WILL_FAIL true)
-
- configure_file(
- "${CMake_SOURCE_DIR}/Tests/CTestTestFailure/testNoExe.cmake.in"
- "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoExe.cmake"
- @ONLY ESCAPE_QUOTES)
- add_test(CTestTestNoExe ${CMAKE_CTEST_COMMAND}
- -S "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoExe.cmake" -V
- --output-log "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testOut2.log"
- )
- set_tests_properties(CTestTestNoExe PROPERTIES DEPENDS CTestTestNoBuild
- PASS_REGULAR_EXPRESSION "Could not find executable"
- FAIL_REGULAR_EXPRESSION "SegFault")
-
if(NOT CMake_TEST_NO_NETWORK)
configure_file(
"${CMake_SOURCE_DIR}/Tests/CTestTestUpload/test.cmake.in"
diff --git a/Tests/CTestTestFailure/CMakeLists.txt b/Tests/CTestTestFailure/CMakeLists.txt
deleted file mode 100644
index b6c1e7a..0000000
--- a/Tests/CTestTestFailure/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required (VERSION 3.5)
-project(CTestTestFailure)
-include(CTest)
-
-add_executable (NoBuild badCode.cxx)
-target_link_libraries (NoBuild ${EXTRA_LIBS})
-
-add_test (TestNoExe NoBuild)
diff --git a/Tests/CTestTestFailure/CTestConfig.cmake b/Tests/CTestTestFailure/CTestConfig.cmake
deleted file mode 100644
index 5bc1e9e..0000000
--- a/Tests/CTestTestFailure/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/CTestTestFailure/testNoBuild.cmake.in b/Tests/CTestTestFailure/testNoBuild.cmake.in
deleted file mode 100644
index 505916e..0000000
--- a/Tests/CTestTestFailure/testNoBuild.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@-NoBuild")
-
-set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestFailure")
-set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailure")
-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_UPDATE(SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res)
-CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
-CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestFailure/testNoExe.cmake.in b/Tests/CTestTestFailure/testNoExe.cmake.in
deleted file mode 100644
index e3d7742..0000000
--- a/Tests/CTestTestFailure/testNoExe.cmake.in
+++ /dev/null
@@ -1,21 +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@-NoExe")
-
-set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestFailure")
-set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailure")
-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_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index c90d543..223a61c 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -472,7 +472,7 @@ add_test(test1 \"${CMAKE_COMMAND}\" -E false)
add_test(test2 \"${CMAKE_COMMAND}\" -E echo \"hello world\")
add_test(test3 \"${CMAKE_COMMAND}\" -E true)
set_tests_properties(test3 PROPERTIES DISABLED \"ON\")
-add_test(test4 \"${CMAKE_COMMAND}/doesnt_exist\")
+add_test(test4 \"${CMAKE_CURRENT_SOURCE_DIR}/does_not_exist\")
add_test(test5 \"${CMAKE_COMMAND}\" -E echo \"please skip\")
set_tests_properties(test5 PROPERTIES SKIP_REGULAR_EXPRESSION \"please skip\")
")
diff --git a/Tests/RunCMake/CTestCommandLine/output-junit-stderr.txt b/Tests/RunCMake/CTestCommandLine/output-junit-stderr.txt
index ce30dc8..c57c378 100644
--- a/Tests/RunCMake/CTestCommandLine/output-junit-stderr.txt
+++ b/Tests/RunCMake/CTestCommandLine/output-junit-stderr.txt
@@ -1 +1,2 @@
-Unable to find executable: .*doesnt_exist
+Unable to find executable:[^
+]*does_not_exist
diff --git a/Tests/CTestTestFailure/badCode.cxx b/Tests/RunCMake/ctest_build/BuildFailure.cxx
index 8102883..8102883 100644
--- a/Tests/CTestTestFailure/badCode.cxx
+++ b/Tests/RunCMake/ctest_build/BuildFailure.cxx
diff --git a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
index 12525f2..af56ead 100644
--- a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
@@ -13,18 +13,18 @@ endfunction()
run_ctest_build(BuildQuiet QUIET)
run_ctest_build(ParallelLevel PARALLEL_LEVEL 1)
-function(run_BuildFailure)
- set(CASE_CMAKELISTS_SUFFIX_CODE [[
-add_custom_target(BuildFailure ALL COMMAND command-does-not-exist)
-]])
+block()
+ set(LANG CXX)
+ configure_file("${RunCMake_SOURCE_DIR}/BuildFailure.cxx" "${RunCMake_BINARY_DIR}/BuildFailure/BuildFailure.cxx" COPYONLY)
+ set(CASE_CMAKELISTS_SUFFIX_CODE [=[
+ add_executable(BuildFailure BuildFailure.cxx)
+ ]=])
set(CASE_CMAKELISTS_PREFIX_CODE [[
if(NOT CTEST_USE_LAUNCHERS)
message(FATAL_ERROR "CTEST_USE_LAUNCHERS not set")
endif()
]])
- set(CASE_TEST_PREFIX_CODE [[
-cmake_policy(SET CMP0061 NEW)
-]])
+ set(CASE_TEST_PREFIX_CODE "")
set(CASE_TEST_SUFFIX_CODE [[
if (ctest_build_return_value)
message("ctest_build returned non-zero")
@@ -35,13 +35,16 @@ endif()
run_ctest(BuildFailure)
if (RunCMake_GENERATOR MATCHES "Makefiles")
+ set(LANG NONE)
set(CASE_TEST_PREFIX_CODE [[
cmake_policy(VERSION 3.2)
]])
+ set(CASE_CMAKELISTS_SUFFIX_CODE [[
+add_custom_target(BuildFailure ALL COMMAND command-does-not-exist)
+]])
run_ctest(BuildFailure-CMP0061-OLD)
endif()
-endfunction()
-run_BuildFailure()
+endblock()
function(run_BuildChangeId)
set(CASE_TEST_PREFIX_CODE [[
diff --git a/Tests/RunCMake/ctest_test/NotRun-result.txt b/Tests/RunCMake/ctest_test/NotRun-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/NotRun-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_test/NotRun-stderr.txt b/Tests/RunCMake/ctest_test/NotRun-stderr.txt
new file mode 100644
index 0000000..85907f3
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/NotRun-stderr.txt
@@ -0,0 +1,2 @@
+.*Unable to find executable[^
+]*does_not_exist
diff --git a/Tests/RunCMake/ctest_test/NotRun-stdout.txt b/Tests/RunCMake/ctest_test/NotRun-stdout.txt
new file mode 100644
index 0000000..8d60833
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/NotRun-stdout.txt
@@ -0,0 +1,7 @@
+.*Could not find executable[^
+]*does_not_exist
+.*
+50% tests passed, 1 tests failed out of 2
+.*
+The following tests FAILED:
+.*testNotRun \(Not Run\)
diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
index 242a059..d2f3da3 100644
--- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
@@ -53,6 +53,13 @@ unset(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING})
unset(CASE_CTEST_TEST_LOAD)
unset(RunCTest_VERBOSE_FLAG)
+block()
+ set(CASE_CMAKELISTS_SUFFIX_CODE [[
+ add_test(NAME testNotRun COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/does_not_exist)
+ ]])
+ run_ctest_test(NotRun)
+endblock()
+
function(run_TestChangeId)
set(CASE_TEST_PREFIX_CODE [[
set(CTEST_CHANGE_ID "<>1")
@@ -131,8 +138,7 @@ run_TestRepeat(AfterTimeout RETURN_VALUE:0 REPEAT AFTER_TIMEOUT:3)
# test repeat and not run tests interact correctly
set(CASE_CMAKELISTS_SUFFIX_CODE [[
-add_test(NAME testNotRun
- COMMAND ${CMAKE_COMMAND}/doesnt_exist)
+ add_test(NAME testNotRun COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/does_not_exist)
set_property(TEST testNotRun PROPERTY TIMEOUT 5)
]])
run_TestRepeat(NotRun RETURN_VALUE:1 REPEAT UNTIL_PASS:3)
diff --git a/Tests/RunCMake/ctest_test/TestRepeatNotRun-stderr.txt b/Tests/RunCMake/ctest_test/TestRepeatNotRun-stderr.txt
index a69932d..85907f3 100644
--- a/Tests/RunCMake/ctest_test/TestRepeatNotRun-stderr.txt
+++ b/Tests/RunCMake/ctest_test/TestRepeatNotRun-stderr.txt
@@ -1 +1,2 @@
-.*Unable to find executable.*
+.*Unable to find executable[^
+]*does_not_exist
diff --git a/Tests/RunCMake/ctest_test/TestRepeatNotRun-stdout.txt b/Tests/RunCMake/ctest_test/TestRepeatNotRun-stdout.txt
index 72c98bc..8d60833 100644
--- a/Tests/RunCMake/ctest_test/TestRepeatNotRun-stdout.txt
+++ b/Tests/RunCMake/ctest_test/TestRepeatNotRun-stdout.txt
@@ -1,5 +1,7 @@
+.*Could not find executable[^
+]*does_not_exist
.*
50% tests passed, 1 tests failed out of 2
.*
The following tests FAILED:
-.*testNotRun.*Not Run.*
+.*testNotRun \(Not Run\)