diff options
author | Ken Martin <ken.martin@kitware.com> | 2007-01-25 16:16:16 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2007-01-25 16:16:16 (GMT) |
commit | 2f84bd17581920eb5cbfc3b41e8cf477ba6a5853 (patch) | |
tree | 1fa8c0947593a749be89f78ec053eb3ce23f14e8 /Source/cmCTest.cxx | |
parent | f71ad851d81649c59a8f4724d72ba4c935cdefce (diff) | |
download | CMake-2f84bd17581920eb5cbfc3b41e8cf477ba6a5853.zip CMake-2f84bd17581920eb5cbfc3b41e8cf477ba6a5853.tar.gz CMake-2f84bd17581920eb5cbfc3b41e8cf477ba6a5853.tar.bz2 |
ENH: added per test timeout support
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 8ca976d..e06eaec 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1074,7 +1074,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output, //---------------------------------------------------------------------- int cmCTest::RunTest(std::vector<const char*> argv, std::string* output, int *retVal, - std::ostream* log) + std::ostream* log, double testTimeOut) { if(cmSystemTools::SameFile(argv[0], this->CTestSelf.c_str()) && !this->ForceNewCTestProcess) @@ -1087,6 +1087,14 @@ int cmCTest::RunTest(std::vector<const char*> argv, { if(argv[i]) { + // if this test has a test command make sure we pass the timeout in + if (strcmp(argv[i],"--test-command") == 0 && testTimeOut) + { + args.push_back("--test-timeout"); + cmOStringStream msg; + msg << testTimeOut; + args.push_back(msg.str()); + } args.push_back(argv[i]); } } @@ -1128,6 +1136,12 @@ int cmCTest::RunTest(std::vector<const char*> argv, { timeout = this->TimeOut; } + cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "-- timeout set to " + << testTimeOut << std::endl); + if (testTimeOut && testTimeOut < timeout) + { + timeout = testTimeOut; + } // always have at least 1 second if we got to here if (timeout <= 0) { |