mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-13 01:29:02 -05:00
Tests/CTestTimeoutAfterMatch: add case for stop time bug
When there is no timeout, a stop time reason was made for any timeout, including a case where a `TIMEOUT_AFTER_MATCH` would reset the timeout. Add a test case.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
include(RunCMake)
|
||||
include(RunCTest)
|
||||
|
||||
function(run_ctest_TimeoutAfterMatch CASE_NAME)
|
||||
@@ -9,3 +10,24 @@ run_ctest_TimeoutAfterMatch(MissingArg1 "\"-Darg2=Test started\"")
|
||||
run_ctest_TimeoutAfterMatch(MissingArg2 "\"-Darg1=2\"")
|
||||
run_ctest_TimeoutAfterMatch(ShouldTimeout "\"-Darg1=1\" \"-Darg2=Test started\"")
|
||||
run_ctest_TimeoutAfterMatch(ShouldPass "\"-Darg1=15\" \"-Darg2=Test started\"")
|
||||
|
||||
function(run_ctest_cli_TimeoutAfterMatch CASE_NAME)
|
||||
set(test_name "${CASE_NAME}")
|
||||
|
||||
set(RunCMake_TEST_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/${test_name}")
|
||||
set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${test_name}-build")
|
||||
|
||||
if (RunCMake_GENERATOR_IS_MULTI_CONFIG)
|
||||
set(RunCMake_TEST_OPTIONS -DCMAKE_CONFIGURATION_TYPES=Debug)
|
||||
else ()
|
||||
set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
|
||||
endif ()
|
||||
list(APPEND RunCMake_TEST_OPTIONS
|
||||
${ARGN})
|
||||
run_cmake("${test_name}")
|
||||
set(RunCMake_TEST_NO_CLEAN 1)
|
||||
run_cmake_command("${test_name}-build" "${CMAKE_COMMAND}" --build . --config Debug)
|
||||
run_cmake_command("${test_name}-test" "${CMAKE_CTEST_COMMAND}" -C Debug -VV)
|
||||
endfunction()
|
||||
|
||||
run_ctest_cli_TimeoutAfterMatch(ShouldTimeoutNoBaseTimeout "-Dno_timeout=1" "-Darg1=1" "-Darg2=Test started")
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
8
|
||||
@@ -0,0 +1,3 @@
|
||||
^Errors while running CTest
|
||||
Output from these tests are in: .*/Tests/RunCMake/CTestTimeoutAfterMatch/ShouldTimeoutNoBaseTimeout-build/Testing/Temporary/LastTest\.log
|
||||
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely\.$
|
||||
@@ -0,0 +1 @@
|
||||
1/1 Test #1: SleepFor1Second \.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\*\*\*Timeout +[0-9\.]+ sec
|
||||
@@ -0,0 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(TimeoutAfterMatch NONE)
|
||||
enable_testing()
|
||||
add_test(NAME SleepFor1Second COMMAND "${CMAKE_COMMAND}" -P ${CMAKE_SOURCE_DIR}/../SleepFor1Second.cmake)
|
||||
set_property(TEST SleepFor1Second PROPERTY TIMEOUT_AFTER_MATCH "${arg1}" "${arg2}")
|
||||
Reference in New Issue
Block a user