summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake59
1 files changed, 53 insertions, 6 deletions
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index 6b23162..b2de596 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -1,9 +1,33 @@
include(RunCMake)
+include(RunCTest)
+
set(RunCMake_TEST_TIMEOUT 60)
unset(ENV{CTEST_PARALLEL_LEVEL})
unset(ENV{CTEST_OUTPUT_ON_FAILURE})
+run_cmake_command(repeat-opt-bad1
+ ${CMAKE_CTEST_COMMAND} --repeat until-pass
+ )
+run_cmake_command(repeat-opt-bad2
+ ${CMAKE_CTEST_COMMAND} --repeat until-pass:foo
+ )
+run_cmake_command(repeat-opt-bad3
+ ${CMAKE_CTEST_COMMAND} --repeat until-fail:2 --repeat-until-fail 2
+ )
+run_cmake_command(repeat-opt-bad4
+ ${CMAKE_CTEST_COMMAND} --repeat-until-fail 2 --repeat until-fail:2
+ )
+run_cmake_command(repeat-opt-until-pass
+ ${CMAKE_CTEST_COMMAND} --repeat until-pass:2
+ )
+run_cmake_command(repeat-opt-until-fail
+ ${CMAKE_CTEST_COMMAND} --repeat until-fail:2
+ )
+run_cmake_command(repeat-opt-after-timeout
+ ${CMAKE_CTEST_COMMAND} --repeat after-timeout:2
+ )
+
run_cmake_command(repeat-until-fail-bad1
${CMAKE_CTEST_COMMAND} --repeat-until-fail
)
@@ -14,19 +38,39 @@ run_cmake_command(repeat-until-fail-good
${CMAKE_CTEST_COMMAND} --repeat-until-fail 2
)
-function(run_repeat_until_fail_tests)
+function(run_repeat_until_pass_tests)
# Use a single build tree for a few tests without cleaning.
- set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-until-fail-build)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-until-pass-build)
+ run_cmake(repeat-until-pass-cmake)
set(RunCMake_TEST_NO_CLEAN 1)
- file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
- file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake_command(repeat-until-pass-ctest
+ ${CMAKE_CTEST_COMMAND} -C Debug --repeat until-pass:3
+ )
+endfunction()
+run_repeat_until_pass_tests()
+
+function(run_repeat_after_timeout_tests)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-after-timeout-build)
+ run_cmake(repeat-after-timeout-cmake)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(repeat-after-timeout-ctest
+ ${CMAKE_CTEST_COMMAND} -C Debug --repeat after-timeout:3
+ )
+endfunction()
+run_repeat_after_timeout_tests()
+function(run_repeat_until_fail_tests)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-until-fail-build)
run_cmake(repeat-until-fail-cmake)
+ set(RunCMake_TEST_NO_CLEAN 1)
run_cmake_command(repeat-until-fail-ctest
- ${CMAKE_CTEST_COMMAND} -C Debug --repeat-until-fail 3
+ ${CMAKE_CTEST_COMMAND} -C Debug ${ARGN}
)
endfunction()
-run_repeat_until_fail_tests()
+run_repeat_until_fail_tests(--repeat-until-fail 3)
+run_repeat_until_fail_tests(--repeat until-fail:3)
function(run_BadCTestTestfile)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/BadCTestTestfile)
@@ -269,3 +313,6 @@ function(run_ShowOnly)
run_cmake_command(show-only_json-v1 ${CMAKE_CTEST_COMMAND} --show-only=json-v1)
endfunction()
run_ShowOnly()
+
+# Check the configuration type variable is passed
+run_ctest(check-configuration-type)