summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestBuildAndTestHandler.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2007-01-25 16:16:16 (GMT)
committerKen Martin <ken.martin@kitware.com>2007-01-25 16:16:16 (GMT)
commit2f84bd17581920eb5cbfc3b41e8cf477ba6a5853 (patch)
tree1fa8c0947593a749be89f78ec053eb3ce23f14e8 /Source/CTest/cmCTestBuildAndTestHandler.cxx
parentf71ad851d81649c59a8f4724d72ba4c935cdefce (diff)
downloadCMake-2f84bd17581920eb5cbfc3b41e8cf477ba6a5853.zip
CMake-2f84bd17581920eb5cbfc3b41e8cf477ba6a5853.tar.gz
CMake-2f84bd17581920eb5cbfc3b41e8cf477ba6a5853.tar.bz2
ENH: added per test timeout support
Diffstat (limited to 'Source/CTest/cmCTestBuildAndTestHandler.cxx')
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index d82015b..f7b7481 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -29,6 +29,7 @@ cmCTestBuildAndTestHandler::cmCTestBuildAndTestHandler()
this->BuildTwoConfig = false;
this->BuildNoClean = false;
this->BuildNoCMake = false;
+ this->Timeout = 0;
}
//----------------------------------------------------------------------
@@ -146,7 +147,6 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
cmSystemTools::SetErrorCallback(CMakeMessageCallback, &cmakeOutString);
cmSystemTools::SetStdoutCallback(CMakeStdoutCallback, &cmakeOutString);
cmOStringStream out;
- // What is this? double timeout = this->CTest->GetTimeOut();
// if the generator and make program are not specified then it is an error
if (!this->BuildGenerator.size() || !this->BuildMakeProgram.size())
@@ -217,7 +217,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
*outstring = out.str();
}
- // if not test was specified then we are done
+ // if no test was specified then we are done
if (!this->TestCommand.size())
{
return 0;
@@ -361,8 +361,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
out << this->TestCommandArgs[k] << " ";
}
out << "\n";
- // What is this? this->TimeOut = timeout;
- int runTestRes = this->CTest->RunTest(testCommand, &outs, &retval, 0);
+ int runTestRes = this->CTest->RunTest(testCommand, &outs, &retval, 0,
+ this->Timeout);
if(runTestRes != cmsysProcess_State_Exited || retval != 0)
{
out << "Failed to run test command: " << testCommand[0] << "\n";
@@ -432,6 +432,11 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments(
idx++;
this->ExecutableDirectory = allArgs[idx];
}
+ if(currentArg.find("--test-timeout",0) == 0 && idx < allArgs.size() - 1)
+ {
+ idx++;
+ this->Timeout = atof(allArgs[idx].c_str());
+ }
if(currentArg.find("--build-generator",0) == 0 && idx < allArgs.size() - 1)
{
idx++;