diff options
author | Ken Martin <ken.martin@kitware.com> | 2007-06-06 15:02:24 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2007-06-06 15:02:24 (GMT) |
commit | a175613a561d50dc1b2d39d052e11563cd6d8d57 (patch) | |
tree | 280d4fd1af6a12e8ba24b6a6c3e8be8e47c1cc15 /Source/cmCTest.cxx | |
parent | 80de27ace5b86bc169874f1b366c9c0c422ab32a (diff) | |
download | CMake-a175613a561d50dc1b2d39d052e11563cd6d8d57.zip CMake-a175613a561d50dc1b2d39d052e11563cd6d8d57.tar.gz CMake-a175613a561d50dc1b2d39d052e11563cd6d8d57.tar.bz2 |
BUG: better passing of global TIMEOUT to internal ctest invocaitons
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index db6c38c..149fb84 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1083,12 +1083,28 @@ int cmCTest::RunTest(std::vector<const char*> argv, 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 @@ int cmCTest::RunTest(std::vector<const char*> argv, { 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 @@ int cmCTest::RunTest(std::vector<const char*> argv, 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); |