diff options
author | Stephen Manz <6985-SRManz@users.noreply.gitlab.kitware.com> | 2019-06-26 16:01:45 (GMT) |
---|---|---|
committer | Stephen Manz <6985-SRManz@users.noreply.gitlab.kitware.com> | 2019-07-09 16:01:04 (GMT) |
commit | adcbdb143cfd302c6b3ae6da9b53f469e01a900b (patch) | |
tree | e2190101349139d55675998cf1723a54df36c477 /Source/CTest/cmCTestRunTest.cxx | |
parent | 8a42cd155f00d9418fa60f995b466fff7c1afaa5 (diff) | |
download | CMake-adcbdb143cfd302c6b3ae6da9b53f469e01a900b.zip CMake-adcbdb143cfd302c6b3ae6da9b53f469e01a900b.tar.gz CMake-adcbdb143cfd302c6b3ae6da9b53f469e01a900b.tar.bz2 |
CTest: Clean up stdout and logfile output for Pass/Fail regex
For pass regex, display only the element that was found, rather
than all elements
Rename loop variable for fail regex, from pass to fail
For consistency, add space in output for pass
Add tests that find and don't find PASS_REGULAR_EXPRESSION, and a test
that finds FAIL_REGULAR_EXPRESSION, whose LastTest.log files are checked
using *-check.cmake.
Diffstat (limited to 'Source/CTest/cmCTestRunTest.cxx')
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 31976b9..b865cab 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -85,27 +85,30 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) if (pass.first.find(this->ProcessOutput)) { found = true; reason = "Required regular expression found."; + reason += " Regex=["; + reason += pass.second; + reason += "]"; break; } } if (!found) { reason = "Required regular expression not found."; + reason += " Regex=["; + for (auto& pass : this->TestProperties->RequiredRegularExpressions) { + reason += pass.second; + reason += "\n"; + } + reason += "]"; forceFail = true; } - reason += "Regex=["; - for (auto& pass : this->TestProperties->RequiredRegularExpressions) { - reason += pass.second; - reason += "\n"; - } - reason += "]"; } if (!this->TestProperties->ErrorRegularExpressions.empty() && this->FailedDependencies.empty()) { - for (auto& pass : this->TestProperties->ErrorRegularExpressions) { - if (pass.first.find(this->ProcessOutput)) { + for (auto& fail : this->TestProperties->ErrorRegularExpressions) { + if (fail.first.find(this->ProcessOutput)) { reason = "Error regular expression found in output."; reason += " Regex=["; - reason += pass.second; + reason += fail.second; reason += "]"; forceFail = true; break; |