diff options
author | Zack Galbreath <zack.galbreath@kitware.com> | 2016-02-18 18:59:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-03-22 15:17:55 (GMT) |
commit | 993e48d0451b41f8e2c2a59473d9ddc09ada5792 (patch) | |
tree | ef678a032f62e84338653b903e6be7ebc0522d2b /Source/CTest/cmCTestTestHandler.cxx | |
parent | 2b64dc7cabb6eda86f0c8b91b27aee4119ac7ebb (diff) | |
download | CMake-993e48d0451b41f8e2c2a59473d9ddc09ada5792.zip CMake-993e48d0451b41f8e2c2a59473d9ddc09ada5792.tar.gz CMake-993e48d0451b41f8e2c2a59473d9ddc09ada5792.tar.bz2 |
CTest: Optionally use a secondary test timeout after matching output
Allow a test N seconds to complete after we detect a matching line in
its output. Activate this behavior with a new TIMEOUT_AFTER_MATCH test
property.
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index b6a4819..59ed98e 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -2254,6 +2254,31 @@ bool cmCTestTestHandler::SetTestsProperties( { rtit->Directory = val; } + if ( key == "TIMEOUT_AFTER_MATCH" ) + { + std::vector<std::string> propArgs; + cmSystemTools::ExpandListArgument(val, propArgs); + if (propArgs.size() != 2) + { + cmCTestLog(this->CTest, WARNING, + "TIMEOUT_AFTER_MATCH expects two arguments, found " << + propArgs.size() << std::endl); + } + else + { + rtit->AlternateTimeout = atof(propArgs[0].c_str()); + std::vector<std::string> lval; + cmSystemTools::ExpandListArgument(propArgs[1], lval); + std::vector<std::string>::iterator crit; + for ( crit = lval.begin(); crit != lval.end(); ++ crit ) + { + rtit->TimeoutRegularExpressions.push_back( + std::pair<cmsys::RegularExpression, std::string>( + cmsys::RegularExpression(crit->c_str()), + std::string(*crit))); + } + } + } } } } |