summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorZach Mullen <zach.mullen@kitware.com>2011-01-03 19:41:25 (GMT)
committerZach Mullen <zach.mullen@kitware.com>2011-01-03 19:41:25 (GMT)
commit51bb49357495ea2742858ffe9d76ab3f44efc06e (patch)
treef72a5b8ce58fc95f46d2b477196ded88e642cda8 /Source
parentedff9207ed82d241077d66b20087657f74e8b5b9 (diff)
downloadCMake-51bb49357495ea2742858ffe9d76ab3f44efc06e.zip
CMake-51bb49357495ea2742858ffe9d76ab3f44efc06e.tar.gz
CMake-51bb49357495ea2742858ffe9d76ab3f44efc06e.tar.bz2
Test TIMEOUT property explicitly set to zero should be honored
Diffstat (limited to 'Source')
-rw-r--r--Source/CTest/cmCTestRunTest.cxx11
-rw-r--r--Source/CTest/cmCTestRunTest.h4
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx2
-rw-r--r--Source/CTest/cmCTestTestHandler.h1
4 files changed, 13 insertions, 5 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 76ff23a..42a4cff 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -455,7 +455,8 @@ bool cmCTestRunTest::StartTest(size_t total)
{
return false;
}
- return this->ForkProcess(timeout, &this->TestProperties->Environment);
+ return this->ForkProcess(timeout, this->TestProperties->ExplicitTimeout,
+ &this->TestProperties->Environment);
}
//----------------------------------------------------------------------
@@ -598,7 +599,7 @@ double cmCTestRunTest::ResolveTimeout()
}
//----------------------------------------------------------------------
-bool cmCTestRunTest::ForkProcess(double testTimeOut,
+bool cmCTestRunTest::ForkProcess(double testTimeOut, bool explicitTimeout,
std::vector<std::string>* environment)
{
this->TestProcess = new cmProcess;
@@ -619,12 +620,16 @@ bool cmCTestRunTest::ForkProcess(double testTimeOut,
{
timeout = testTimeOut;
}
-
// always have at least 1 second if we got to here
if (timeout <= 0)
{
timeout = 1;
}
+ // handle timeout explicitly set to 0
+ if (testTimeOut == 0 && explicitTimeout)
+ {
+ timeout = 0;
+ }
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index << ": "
<< "Test timeout computed to be: " << timeout << "\n");
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h
index 66e6b7b..89456d5 100644
--- a/Source/CTest/cmCTestRunTest.h
+++ b/Source/CTest/cmCTestRunTest.h
@@ -63,8 +63,8 @@ private:
void ExeNotFound(std::string exe);
// Figures out a final timeout which is min(STOP_TIME, NOW+TIMEOUT)
double ResolveTimeout();
- bool ForkProcess(double testTimeOut,
- std::vector<std::string>* environment);
+ bool ForkProcess(double testTimeOut, bool explicitTimeout,
+ std::vector<std::string>* environment);
void WriteLogOutputTop(size_t completed, size_t total);
//Run post processing of the process output for MemCheck
void MemCheckPostProcess();
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 6d1af2d..fdafb9b 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -2122,6 +2122,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "TIMEOUT" )
{
rtit->Timeout = atof(val.c_str());
+ rtit->ExplicitTimeout = true;
}
if ( key == "COST" )
{
@@ -2295,6 +2296,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
test.WillFail = false;
test.RunSerial = false;
test.Timeout = 0;
+ test.ExplicitTimeout = false;
test.Cost = 0;
test.Processors = 1;
test.PreviousRuns = 0;
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index 7049564..7aa8522 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -99,6 +99,7 @@ public:
int PreviousRuns;
bool RunSerial;
double Timeout;
+ bool ExplicitTimeout;
int Index;
//Requested number of process slots
int Processors;