mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-17 18:35:40 +02:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user