From 1e72091e8631f1a94262a1a10b58d6b0a975db01 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Wed, 13 Jul 2005 10:17:18 -0400 Subject: ENH: Add timeout support --- Source/CTest/cmCTestTestCommand.cxx | 12 ++++++++++++ Source/cmCTest.h | 1 + 2 files changed, 13 insertions(+) diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx index 6be718c..a802f92 100644 --- a/Source/CTest/cmCTestTestCommand.cxx +++ b/Source/CTest/cmCTestTestCommand.cxx @@ -30,6 +30,18 @@ cmCTestTestCommand::cmCTestTestCommand() cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler() { + const char* ctestTimeout = m_Makefile->GetDefinition("CTEST_TEST_TIMEOUT"); + double timeout = m_CTest->GetTimeOut(); + if ( ctestTimeout ) + { + timeout = atof(ctestTimeout); + } + else + { + // By default use timeout of 10 minutes + timeout = 600; + } + m_CTest->SetTimeOut(timeout); cmCTestGenericHandler* handler = m_CTest->GetInitializedHandler("test"); if ( m_Values[ctt_START] || m_Values[ctt_END] || m_Values[ctt_STRIDE] ) { diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 3cc3fe4..9ca2844 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -92,6 +92,7 @@ public: ///! what is the configuraiton type, e.g. Debug, Release etc. std::string GetConfigType(); double GetTimeOut() { return m_TimeOut; } + void SetTimeOut(double t) { m_TimeOut = t; } /** * Check if CTest file exists -- cgit v0.12