From 47702b8d49d686d4db2c66b6abd872517480d718 Mon Sep 17 00:00:00 2001 From: Nils Gladitz Date: Tue, 25 Feb 2014 11:25:41 +0100 Subject: [PATCH] CTest: exclude /showIncludes notes when scraping logs My last related commit e5e3f3d4 (CTest: filter /showIncludes output from ninja compile launcher, 2013-12-01) filtered /showIncludes messages from the generated xml output but they also need to be filtered in ScrapeLog(). Otherwise they are being detected as warnings when using compilers withs english diagnostics. --- Source/CTest/cmCTestLaunch.cxx | 19 +++++++++++++++++-- Source/CTest/cmCTestLaunch.h | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 7d9c03486..cd3bd5746 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -587,8 +587,7 @@ void cmCTestLaunch::DumpFileToXML(std::ostream& fxml, while(cmSystemTools::GetLineFromStream(fin, line)) { - if(OptionFilterPrefix.size() && cmSystemTools::StringStartsWith( - line.c_str(), OptionFilterPrefix.c_str())) + if(MatchesFilterPrefix(line)) { continue; } @@ -676,6 +675,11 @@ bool cmCTestLaunch::ScrapeLog(std::string const& fname) std::string line; while(cmSystemTools::GetLineFromStream(fin, line)) { + if(MatchesFilterPrefix(line)) + { + continue; + } + if(this->Match(line.c_str(), this->RegexWarning) && !this->Match(line.c_str(), this->RegexWarningSuppress)) { @@ -700,6 +704,17 @@ bool cmCTestLaunch::Match(std::string const& line, return false; } +//---------------------------------------------------------------------------- +bool cmCTestLaunch::MatchesFilterPrefix(std::string const& line) const +{ + if(this->OptionFilterPrefix.size() && cmSystemTools::StringStartsWith( + line.c_str(), this->OptionFilterPrefix.c_str())) + { + return true; + } + return false; +} + //---------------------------------------------------------------------------- int cmCTestLaunch::Main(int argc, const char* const argv[]) { diff --git a/Source/CTest/cmCTestLaunch.h b/Source/CTest/cmCTestLaunch.h index a86a9df74..f680d19d9 100644 --- a/Source/CTest/cmCTestLaunch.h +++ b/Source/CTest/cmCTestLaunch.h @@ -88,6 +88,7 @@ private: bool ScrapeLog(std::string const& fname); bool Match(std::string const& line, std::vector& regexps); + bool MatchesFilterPrefix(std::string const& line) const; // Methods to generate the xml fragment. void WriteXML();