From 12cf7bc507e914c48289b73d241c5c9fea091ce8 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Sat, 11 May 2013 12:14:37 +0200 Subject: [PATCH] CTest: break after first regex match on output PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION both take a list of expressions. Stop searching if the first of those has matched the output as the result will not change anymore. --- Source/CTest/cmCTestRunTest.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 5eabf3fbe..fc1bcb50a 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -166,6 +166,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) { found = true; reason = "Required regular expression found."; + break; } } if ( !found ) @@ -196,6 +197,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) reason += passIt->second; reason += "]"; forceFail = true; + break; } } }