Tests: Remove redundant CTestTestTimeout test

It was superseded by commit 2f5eb1800b (Tests: Add RunCMake.CTestTimeout
test, 2020-01-13, v3.17.0-rc1~169^2~1) but was kept as a dependency of
the `CTestTestRerunFailed` test.  The latter has now been moved into
`RunCMake.CTestCommandLine`, so neither is needed.
This commit is contained in:
Brad King
2025-12-08 15:19:06 -05:00
parent 8f848dbc1f
commit 4a67306ddb
6 changed files with 0 additions and 104 deletions

View File

@@ -3035,18 +3035,6 @@ if(BUILD_TESTING)
set_tests_properties(CTestTestSubdir PROPERTIES
PASS_REGULAR_EXPRESSION "0 tests failed out of 3")
configure_file(
"${CMake_SOURCE_DIR}/Tests/CTestTestTimeout/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestTimeout/test.cmake"
@ONLY ESCAPE_QUOTES)
add_test(CTestTestTimeout ${CMAKE_CTEST_COMMAND}
-C "\${CTestTest_CONFIG}"
-S "${CMake_BINARY_DIR}/Tests/CTestTestTimeout/test.cmake" -V
--output-log "${CMake_BINARY_DIR}/Tests/CTestTestTimeout/testOutput.log"
)
set_tests_properties(CTestTestTimeout PROPERTIES
PASS_REGULAR_EXPRESSION "TestTimeout *\\.+ *\\*\\*\\*Timeout.*TestSleep *\\.+ *Passed.*timeout correctly killed child")
configure_file(
"${CMake_SOURCE_DIR}/Tests/CTestTestDepends/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake"

View File

@@ -1,21 +0,0 @@
cmake_minimum_required(VERSION 3.10)
project(CTestTestTimeout)
include(CTest)
if(NOT TIMEOUT)
# Give the process time to load and start running.
set(TIMEOUT 4)
endif()
add_definitions(-DTIMEOUT=${TIMEOUT})
add_executable (Sleep sleep.c)
add_test(NAME TestTimeout
COMMAND ${CMAKE_COMMAND} -D Sleep=$<TARGET_FILE:Sleep>
-D Log=${CMAKE_CURRENT_BINARY_DIR}/timeout.log
-P ${CMAKE_CURRENT_SOURCE_DIR}/timeout.cmake
)
set_tests_properties(TestTimeout PROPERTIES TIMEOUT ${TIMEOUT})
add_test(NAME TestSleep COMMAND Sleep)
set_tests_properties(TestSleep PROPERTIES DEPENDS TestTimeout)

View File

@@ -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")

View File

@@ -1,21 +0,0 @@
#if defined(_WIN32)
# include <windows.h>
#else
# include <unistd.h>
#endif
#include <stdio.h>
int main(void)
{
fprintf(stderr, "before sleep\n");
fflush(stderr); /* should not be needed, but just in case */
#if defined(_WIN32)
Sleep((TIMEOUT + 4) * 1000);
#else
sleep((TIMEOUT + 4));
#endif
fprintf(stderr, "after sleep\n");
fflush(stderr); /* should not be needed, but just in case */
return 0;
}

View File

@@ -1,40 +0,0 @@
cmake_minimum_required(VERSION 3.10)
# Settings:
set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
set(CTEST_SITE "@SITE@")
set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Timeout")
set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestTimeout")
set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestTimeout")
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})
file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
TIMEOUT:STRING=@CTestTestTimeout_TIME@
")
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)
set(log ${CTEST_BINARY_DIRECTORY}/timeout.log)
if(EXISTS "${log}")
# Verify that the timeout test did not finish sleeping.
file(STRINGS "${log}" after_sleep REGEX "after sleep")
if(after_sleep)
message(FATAL_ERROR "Log indicates timeout did not kill child.")
else()
message(STATUS "Log indicates timeout correctly killed child.")
endif()
else()
message(FATAL_ERROR "Log does not exist:\n ${log}")
endif()

View File

@@ -1,6 +0,0 @@
# Remove the log file.
file(REMOVE ${Log})
# Run a child that sleeps longer than the timeout of this test.
# Log its output so check.cmake can verify it dies.
execute_process(COMMAND ${Sleep} ERROR_FILE ${Log})