More config refactoring

This commit is contained in:
Phil Nash
2013-05-29 18:34:11 +01:00
parent be8fd82f20
commit 3c3beb57c3
4 changed files with 32 additions and 32 deletions

View File

@@ -466,7 +466,7 @@ namespace Catch {
"just pass this option.";
}
virtual void parseIntoConfig( Command const&, ConfigData& config ) {
config.includeWhichResults = Include::SuccessfulResults;
config.showSuccessfulTests = true;
}
};
@@ -590,7 +590,7 @@ namespace Catch {
}
virtual void parseIntoConfig( Command const&, ConfigData& config ) {
config.allowThrows = false;
config.noThrow = true;
}
};

View File

@@ -59,17 +59,17 @@ namespace Catch {
ConfigData()
: listSpec( List::None ),
includeWhichResults( Include::FailedOnly ),
showSuccessfulTests( false ),
shouldDebugBreak( false ),
allowThrows( true ),
noThrow( false ),
cutoff( -1 ),
warnings( WarnAbout::Nothing )
{}
List::What listSpec; // !TBD Split into bools
Include::WhichResults includeWhichResults; // !TBD bool
bool showSuccessfulTests;
bool shouldDebugBreak;
bool allowThrows; // !TBD invert
bool noThrow;
// bool showHelp; // !TBD
int cutoff;
@@ -159,10 +159,10 @@ namespace Catch {
}
// IConfig interface
virtual bool allowThrows() const { return m_data.allowThrows; }
virtual bool allowThrows() const { return !m_data.noThrow; }
virtual std::ostream& stream() const { return m_os; }
virtual std::string name() const { return m_data.name; }
virtual bool includeSuccessfulResults() const { return m_data.includeWhichResults == Include::SuccessfulResults; }
virtual bool includeSuccessfulResults() const { return m_data.showSuccessfulTests; }
virtual bool warnAboutMissingAssertions() const { return m_data.warnings & ConfigData::WarnAbout::NoAssertions; }
private: