First cut of Timer class.

- started integrating with reporters (now (optionally) supported in console reporter).
- introduced Node<> template to help with cumulative reporting and used it instead of ThreadedSectionInfo.
This commit is contained in:
Phil Nash
2013-08-07 18:56:35 +01:00
parent 649f8c24b1
commit 6339254cb2
16 changed files with 379 additions and 174 deletions

View File

@@ -24,15 +24,21 @@ namespace Catch {
inline void addWarning( ConfigData& config, std::string const& _warning ) {
if( _warning == "NoAssertions" )
config.warnings = (ConfigData::WarnAbout::What)( config.warnings | ConfigData::WarnAbout::NoAssertions );
config.warnings = (WarnAbout::What)( config.warnings | WarnAbout::NoAssertions );
else
throw std::runtime_error( "Unrecognised warning: '" + _warning + "'" );
}
inline void setVerbosity( ConfigData& config, int level ) {
// !TBD: accept strings?
config.verbosity = (ConfigData::Verbosity::Level)level;
config.verbosity = (Verbosity::Level)level;
}
inline void setShowDurations( ConfigData& config, bool _showDurations ) {
config.showDurations = _showDurations
? ShowDurations::Always
: ShowDurations::Never;
}
inline Clara::CommandLine<ConfigData> makeCommandLineParser() {
@@ -121,6 +127,12 @@ namespace Catch {
.describe( "which test or tests to use" )
.argName( "test name, pattern or tags" );
cli.bind( &setShowDurations )
.describe( "show test durations" )
.shortOpt( "d")
.longOpt( "durations" )
.argName( "durations" );
return cli;
}