Refactoring towards interface based config

This commit is contained in:
Phil Nash
2013-05-28 18:39:32 +01:00
parent 10fa0593db
commit e1459955f1
17 changed files with 754 additions and 245 deletions

View File

@@ -16,7 +16,7 @@
namespace Catch {
class XmlReporter : public SharedImpl<IReporter> {
public:
XmlReporter( const ReporterConfig& config ) : m_config( config ) {}
XmlReporter( ReporterConfig const& config ) : m_config( config ) {}
static std::string getDescription() {
return "Reports test results as an XML document";
@@ -32,8 +32,8 @@ namespace Catch {
virtual void StartTesting() {
m_xml = XmlWriter( m_config.stream() );
m_xml.startElement( "Catch" );
if( !m_config.name().empty() )
m_xml.writeAttribute( "name", m_config.name() );
if( !m_config.fullConfig()->name().empty() )
m_xml.writeAttribute( "name", m_config.fullConfig()->name() );
}
virtual void EndTesting( const Totals& totals ) {
@@ -76,7 +76,7 @@ namespace Catch {
}
virtual void Result( const Catch::AssertionResult& assertionResult ) {
if( !m_config.includeSuccessfulResults() && assertionResult.getResultType() == ResultWas::Ok )
if( !m_config.fullConfig()->includeSuccessfulResults() && assertionResult.getResultType() == ResultWas::Ok )
return;
if( assertionResult.hasExpression() ) {