[cmake-commits] martink committed cmCTest.cxx 1.318 1.319
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Jun 6 11:02:26 EDT 2007
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv20791
Modified Files:
cmCTest.cxx
Log Message:
BUG: better passing of global TIMEOUT to internal ctest invocaitons
Index: cmCTest.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCTest.cxx,v
retrieving revision 1.318
retrieving revision 1.319
diff -u -d -r1.318 -r1.319
--- cmCTest.cxx 4 Jun 2007 17:39:43 -0000 1.318
+++ cmCTest.cxx 6 Jun 2007 15:02:24 -0000 1.319
@@ -1083,12 +1083,28 @@
std::string* output, int *retVal,
std::ostream* log, double testTimeOut)
{
+ // determine how much time we have
+ double timeout = this->GetRemainingTimeAllowed() - 120;
+ if (this->TimeOut && this->TimeOut < timeout)
+ {
+ timeout = this->TimeOut;
+ }
+ if (testTimeOut && testTimeOut < timeout)
+ {
+ timeout = testTimeOut;
+ }
+ // always have at least 1 second if we got to here
+ if (timeout <= 0)
+ {
+ timeout = 1;
+ }
+
if(cmSystemTools::SameFile(argv[0], this->CTestSelf.c_str()) &&
!this->ForceNewCTestProcess)
{
cmCTest inst;
inst.ConfigType = this->ConfigType;
- inst.TimeOut = this->TimeOut;
+ inst.TimeOut = timeout;
std::vector<std::string> args;
for(unsigned int i =0; i < argv.size(); ++i)
{
@@ -1101,7 +1117,7 @@
{
args.push_back("--test-timeout");
cmOStringStream msg;
- msg << testTimeOut;
+ msg << timeout;
args.push_back(msg.str());
}
args.push_back(argv[i]);
@@ -1139,22 +1155,6 @@
cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
}
- // do we have time for
- double timeout = this->GetRemainingTimeAllowed() - 120;
- if (this->TimeOut && this->TimeOut < timeout)
- {
- timeout = this->TimeOut;
- }
- if (testTimeOut && testTimeOut < timeout)
- {
- timeout = testTimeOut;
- }
- // always have at least 1 second if we got to here
- if (timeout <= 0)
- {
- timeout = 1;
- }
-
cmsysProcess_SetTimeout(cp, timeout);
cmsysProcess_Execute(cp);
More information about the Cmake-commits
mailing list