diff options
author | Nils Gladitz <nilsgladitz@gmail.com> | 2013-12-01 22:16:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-12-03 14:25:53 (GMT) |
commit | e5e3f3d4ff79d27450618edb01890fc99f212d12 (patch) | |
tree | 7e0f3abd82a420dab573e536ab6c507d13bcdb43 /Source/CTest | |
parent | 845cdbc60ed0f6ab8bfd94bb7175826edbf8565b (diff) | |
download | CMake-e5e3f3d4ff79d27450618edb01890fc99f212d12.zip CMake-e5e3f3d4ff79d27450618edb01890fc99f212d12.tar.gz CMake-e5e3f3d4ff79d27450618edb01890fc99f212d12.tar.bz2 |
CTest: filter /showIncludes output from ninja compile launcher
Teach "ctest --launch" a new "--filter-prefix" option. Set it using
the CMAKE_CL_SHOWINCLUDES_PREFIX value with the Ninja generator.
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestLaunch.cxx | 19 | ||||
-rw-r--r-- | Source/CTest/cmCTestLaunch.h | 1 |
2 files changed, 19 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 9831d02..8e5fd78 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -64,7 +64,8 @@ bool cmCTestLaunch::ParseArguments(int argc, const char* const* argv) DoingTargetName, DoingTargetType, DoingBuildDir, - DoingCount }; + DoingCount, + DoingFilterPrefix }; Doing doing = DoingNone; int arg0 = 0; for(int i=1; !arg0 && i < argc; ++i) @@ -98,6 +99,10 @@ bool cmCTestLaunch::ParseArguments(int argc, const char* const* argv) { doing = DoingBuildDir; } + else if(strcmp(arg, "--filter-prefix") == 0) + { + doing = DoingFilterPrefix; + } else if(doing == DoingOutput) { this->OptionOutput = arg; @@ -132,6 +137,11 @@ bool cmCTestLaunch::ParseArguments(int argc, const char* const* argv) this->OptionBuildDir = arg; doing = DoingNone; } + else if(doing == DoingFilterPrefix) + { + this->OptionFilterPrefix = arg; + doing = DoingNone; + } } // Extract the real command line. @@ -573,8 +583,15 @@ void cmCTestLaunch::DumpFileToXML(std::ostream& fxml, std::string line; const char* sep = ""; + while(cmSystemTools::GetLineFromStream(fin, line)) { + if(OptionFilterPrefix.size() && cmSystemTools::StringStartsWith( + line.c_str(), OptionFilterPrefix.c_str())) + { + continue; + } + fxml << sep << cmXMLSafe(line).Quotes(false); sep = "\n"; } diff --git a/Source/CTest/cmCTestLaunch.h b/Source/CTest/cmCTestLaunch.h index 7457e83..a86a9df 100644 --- a/Source/CTest/cmCTestLaunch.h +++ b/Source/CTest/cmCTestLaunch.h @@ -45,6 +45,7 @@ private: std::string OptionTargetName; std::string OptionTargetType; std::string OptionBuildDir; + std::string OptionFilterPrefix; bool ParseArguments(int argc, const char* const* argv); // The real command line appearing after launcher arguments. |