mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-22 20:45:39 +02:00
added new timing related command line options
2 new timing related command line options have been added: - performance-timings [-p]: print out performance timings per test case and group - performance-timings-threshold [-q <secs>]: print out only the timings exceeding this given threshold value
This commit is contained in:
@@ -93,6 +93,17 @@ namespace Catch {
|
||||
.longOpt( "name" )
|
||||
.argName( "name" );
|
||||
|
||||
cli.bind( &ConfigData::showTimings )
|
||||
.describe( "print out performance timings per test case and group" )
|
||||
.shortOpt( "p")
|
||||
.longOpt( "performance-timings" );
|
||||
|
||||
cli.bind( &ConfigData::timingsThreshold )
|
||||
.describe( "print out only the timings exceeding this given threshold value [in seconds]" )
|
||||
.shortOpt( "q")
|
||||
.longOpt( "performance-timings-theshold" )
|
||||
.argName( "threshold" );
|
||||
|
||||
cli.bind( &abortAfterFirst )
|
||||
.describe( "abort at first failure" )
|
||||
.shortOpt( "a")
|
||||
|
@@ -45,6 +45,8 @@ namespace Catch {
|
||||
shouldDebugBreak( false ),
|
||||
noThrow( false ),
|
||||
showHelp( false ),
|
||||
showTimings( false ),
|
||||
timingsThreshold( 0.0 ),
|
||||
abortAfter( -1 ),
|
||||
verbosity( Verbosity::Normal ),
|
||||
warnings( WarnAbout::Nothing )
|
||||
@@ -59,6 +61,9 @@ namespace Catch {
|
||||
bool noThrow;
|
||||
bool showHelp;
|
||||
|
||||
bool showTimings;
|
||||
double timingsThreshold;
|
||||
|
||||
int abortAfter;
|
||||
|
||||
Verbosity::Level verbosity;
|
||||
@@ -167,7 +172,8 @@ namespace Catch {
|
||||
virtual std::string name() const { return m_data.name.empty() ? m_data.processName : m_data.name; }
|
||||
virtual bool includeSuccessfulResults() const { return m_data.showSuccessfulTests; }
|
||||
virtual bool warnAboutMissingAssertions() const { return m_data.warnings & ConfigData::WarnAbout::NoAssertions; }
|
||||
|
||||
virtual bool showTimings() const { return m_data.showTimings; }
|
||||
virtual double timingsThreshold() const { return m_data.timingsThreshold; }
|
||||
private:
|
||||
ConfigData m_data;
|
||||
|
||||
|
@@ -25,6 +25,8 @@ namespace Catch {
|
||||
virtual bool includeSuccessfulResults() const = 0;
|
||||
virtual bool shouldDebugBreak() const = 0;
|
||||
virtual bool warnAboutMissingAssertions() const = 0;
|
||||
virtual bool showTimings() const = 0;
|
||||
virtual double timingsThreshold() const = 0;
|
||||
virtual int abortAfter() const = 0;
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user