diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2009-02-24 22:23:51 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2009-02-24 22:23:51 (GMT) |
commit | 3b73cdc89fdcdbbf1708bc6a2312a00bd2325711 (patch) | |
tree | 33415a1595acccc5517686b312f1982906914437 /Source/CTest/cmCTestTestHandler.cxx | |
parent | 1353ed0bd8d2d530fda16b3c407f085b3f77af9d (diff) | |
download | CMake-3b73cdc89fdcdbbf1708bc6a2312a00bd2325711.zip CMake-3b73cdc89fdcdbbf1708bc6a2312a00bd2325711.tar.gz CMake-3b73cdc89fdcdbbf1708bc6a2312a00bd2325711.tar.bz2 |
ENH: add a CDash measured value showing the reason for passed and failed tests based on regular expressions
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 7f3b995..7cd2839 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -799,22 +799,23 @@ void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it, if ( passIt->first.find(output.c_str()) ) { found = true; + reason = "Required regular expression found."; } } if ( !found ) { reason = "Required regular expression not found."; - reason += "Regex=["; - for ( passIt = it->RequiredRegularExpressions.begin(); + forceFail = true; + } + reason += "Regex=["; + for ( passIt = it->RequiredRegularExpressions.begin(); passIt != it->RequiredRegularExpressions.end(); ++ passIt ) - { - reason += passIt->second; - reason += "\n"; - } - reason += "]"; - forceFail = true; + { + reason += passIt->second; + reason += "\n"; } + reason += "]"; } if ( it->ErrorRegularExpressions.size() > 0 ) { @@ -947,7 +948,7 @@ void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it, (this->CustomMaximumFailedTestOutputSize)); } } - + cres.Reason = reason; cres.Output = output; cres.ReturnValue = retVal; cres.CompletionStatus = "Completed"; @@ -1585,6 +1586,19 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os) << "name=\"Execution Time\"><Value>" << result->ExecutionTime << "</Value></NamedMeasurement>\n"; + if(result->Reason.size()) + { + const char* reasonType = "Pass Reason"; + if(result->Status != cmCTestTestHandler::COMPLETED && + result->Status != cmCTestTestHandler::NOT_RUN) + { + reasonType = "Fail Reason"; + } + os << "\t\t\t<NamedMeasurement type=\"text/string\" " + << "name=\"" << reasonType << "\"><Value>" + << cmXMLSafe(result->Reason) + << "</Value></NamedMeasurement>\n"; + } os << "\t\t\t<NamedMeasurement type=\"text/string\" " << "name=\"Completion Status\"><Value>" |