diff options
author | Zach Mullen <zach.mullen@kitware.com> | 2009-12-16 19:50:16 (GMT) |
---|---|---|
committer | Zach Mullen <zach.mullen@kitware.com> | 2009-12-16 19:50:16 (GMT) |
commit | 9add940eb6a23b32da6a86b857d05fed900fea74 (patch) | |
tree | 949d99f8fdc69b3194a021739859de2ce3ae0764 /Source/CTest | |
parent | 56fe170043548e42728105ada644941fc3ae978b (diff) | |
download | CMake-9add940eb6a23b32da6a86b857d05fed900fea74.zip CMake-9add940eb6a23b32da6a86b857d05fed900fea74.tar.gz CMake-9add940eb6a23b32da6a86b857d05fed900fea74.tar.bz2 |
Added an option to conditionally attach files to a test submission only if the test does not pass. Also some preliminary changes for test output compression.
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 27 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.h | 1 |
2 files changed, 24 insertions, 4 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index effa995..900165e 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1259,6 +1259,14 @@ void cmCTestTestHandler::WriteTestResultFooter(std::ostream& os, void cmCTestTestHandler::AttachFiles(std::ostream& os, cmCTestTestResult* result) { + if(result->Status != cmCTestTestHandler::COMPLETED + && result->Properties->AttachOnFail.size()) + { + result->Properties->AttachedFiles.insert( + result->Properties->AttachedFiles.end(), + result->Properties->AttachOnFail.begin(), + result->Properties->AttachOnFail.end()); + } for(std::vector<std::string>::const_iterator file = result->Properties->AttachedFiles.begin(); file != result->Properties->AttachedFiles.end(); ++file) @@ -1268,9 +1276,9 @@ void cmCTestTestHandler::AttachFiles(std::ostream& os, os << "\t\t<NamedMeasurement name=\"Attached File\" encoding=\"base64\" " "compression=\"tar/gzip\" filename=\"" << fname << "\" type=\"file\">" "\n\t\t\t<Value>\n\t\t\t" - << base64 - << "\n\t\t\t</Value>\n\t\t</NamedMeasurement>\n"; - } + << base64 + << "\n\t\t\t</Value>\n\t\t</NamedMeasurement>\n"; + } } //---------------------------------------------------------------------- @@ -1355,7 +1363,7 @@ void cmCTestTestHandler std::vector<std::string> &attemptedConfigs, std::string filepath, std::string &filename) -{ +{ std::string tempPath; if (filepath.size() && @@ -2077,6 +2085,17 @@ bool cmCTestTestHandler::SetTestsProperties( rtit->AttachedFiles.push_back(*f); } } + if ( key == "ATTACHED_FILES_ON_FAIL" ) + { + std::vector<std::string> lval; + cmSystemTools::ExpandListArgument(val.c_str(), lval); + + for(std::vector<std::string>::iterator f = lval.begin(); + f != lval.end(); ++f) + { + rtit->AttachOnFail.push_back(*f); + } + } if ( key == "TIMEOUT" ) { rtit->Timeout = atof(val.c_str()); diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index d4e92f0..a78cada 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -87,6 +87,7 @@ public: std::vector<std::string> RequiredFiles; std::vector<std::string> Depends; std::vector<std::string> AttachedFiles; + std::vector<std::string> AttachOnFail; std::vector<std::pair<cmsys::RegularExpression, std::string> > ErrorRegularExpressions; std::vector<std::pair<cmsys::RegularExpression, |