Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2014-12-30 18:24:31 +0000
committerPhil Nash2014-12-30 18:24:31 +0000
commit6817bb099db44744cc32da193cbe710ffcead8b8 (patch)
tree7763a90b53f3c10dd3af4525ce3da103c0c068e8 /include
parent3e0c5018123e7e32b3c35f4169cbdca4bcb8f332 (diff)
downloadcatch3-6817bb099db44744cc32da193cbe710ffcead8b8.tar.gz
Fixed up xml reporter and rebased
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_totals.hpp3
-rw-r--r--include/reporters/catch_reporter_xml.hpp11
2 files changed, 8 insertions, 6 deletions
diff --git a/include/internal/catch_totals.hpp b/include/internal/catch_totals.hpp
index 75386ae8..551e2947 100644
--- a/include/internal/catch_totals.hpp
+++ b/include/internal/catch_totals.hpp
@@ -35,6 +35,9 @@ namespace Catch {
bool allPassed() const {
return failed == 0 && failedButOk == 0;
}
+ bool allOk() const {
+ return failed == 0;
+ }
std::size_t passed;
std::size_t failed;
diff --git a/include/reporters/catch_reporter_xml.hpp b/include/reporters/catch_reporter_xml.hpp
index 1b7c0199..08971d1f 100644
--- a/include/reporters/catch_reporter_xml.hpp
+++ b/include/reporters/catch_reporter_xml.hpp
@@ -99,7 +99,7 @@ namespace Catch {
if( assertionResult.hasExpression() ) {
m_xml.startElement( "Expression" )
.writeAttribute( "success", assertionResult.succeeded() )
- .writeAttribute( "type", assertionResult.getTestMacroName() )
+// .writeAttribute( "type", assertionResult.getTestMacroName() )
.writeAttribute( "filename", assertionResult.getSourceInfo().file )
.writeAttribute( "line", assertionResult.getSourceInfo().line );
@@ -111,8 +111,6 @@ namespace Catch {
// And... Print a result applicable to each result type.
switch( assertionResult.getResultType() ) {
- default:
- break;
case ResultWas::ThrewException:
m_xml.scopedElement( "Exception" )
.writeAttribute( "filename", assertionResult.getSourceInfo().file )
@@ -130,13 +128,14 @@ namespace Catch {
.writeText( assertionResult.getMessage() );
break;
case ResultWas::Warning:
- m_xml.scopedElement( "Warning" )
- .writeText( assertionResult.getMessage() );
+ // Warning will already have been written
break;
case ResultWas::ExplicitFailure:
m_xml.scopedElement( "Failure" )
.writeText( assertionResult.getMessage() );
break;
+ default:
+ break;
}
if( assertionResult.hasExpression() )
@@ -163,7 +162,7 @@ namespace Catch {
virtual void testCaseEnded( TestCaseStats const& testCaseStats ) {
StreamingReporterBase::testCaseEnded( testCaseStats );
XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResult" );
- e.writeAttribute( "success", testCaseStats.totals.assertions.allPassed() );
+ e.writeAttribute( "success", testCaseStats.totals.assertions.allOk() );
if ( m_config->showDurations() == ShowDurations::Always )
e.writeAttribute( "durationInSeconds", m_testCaseTimer.getElapsedSeconds() );