Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include/internal/catch_commandline.cpp
diff options
context:
space:
mode:
authorPhil Nash2017-08-11 19:55:55 +0100
committerPhil Nash2017-08-15 13:48:14 +0100
commit917a51da6b9923d385c2e441bef1ebedb96cd123 (patch)
tree8a613709e39d465397601544153e8a38d752fbc0 /include/internal/catch_commandline.cpp
parentf06ed856d86ceb3457cb88b167570c01d6566cb2 (diff)
downloadcatch3-917a51da6b9923d385c2e441bef1ebedb96cd123.tar.gz
Added libidentify support, including option for waiting for keypress on exit (and/ or start)
Diffstat (limited to 'include/internal/catch_commandline.cpp')
-rw-r--r--include/internal/catch_commandline.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/internal/catch_commandline.cpp b/include/internal/catch_commandline.cpp
index 7342ac42..d92a1c39 100644
--- a/include/internal/catch_commandline.cpp
+++ b/include/internal/catch_commandline.cpp
@@ -71,6 +71,18 @@ namespace Catch {
return ParserResult::runtimeError( "colour mode must be one of: auto, yes or no. '" + useColour + "' not recognised" );
return ParserResult::ok( ParseResultType::Matched );
};
+ auto const setWaitForKeypress = [&]( std::string const& keypress ) {
+ auto keypressLc = toLower( keypress );
+ if( keypressLc == "start" )
+ config.waitForKeypress = WaitForKeypress::BeforeStart;
+ else if( keypressLc == "exit" )
+ config.waitForKeypress = WaitForKeypress::BeforeExit;
+ else if( keypressLc == "both" )
+ config.waitForKeypress = WaitForKeypress::BeforeStartAndExit;
+ else
+ return ParserResult::runtimeError( "keypress argument must be one of: start, exit or both. '" + keypress + "' not recognised" );
+ return ParserResult::ok( ParseResultType::Matched );
+ };
auto const setVerbosity = [&]( std::string const& verbosity ) {
auto lcVerbosity = toLower( verbosity );
if( lcVerbosity == "quiet" )
@@ -153,6 +165,12 @@ namespace Catch {
+ Opt( setColourUsage, "yes|no" )
["--use-colour"]
( "should output be colourised" )
+ + Opt( config.libIdentify )
+ ["--libidentify"]
+ ( "report name and version according to libidentify standard" )
+ + Opt( setWaitForKeypress, "start|exit|both" )
+ ["--wait-for-keypress"]
+ ( "waits for a keypress before exiting" )
+ Opt( config.benchmarkResolutionMultiple, "multiplier" )
["--benchmark-resolution-multiple"]
( "multiple of clock resolution to run benchmarks" )