Another attempt to fix VS ICEs - split cli parser up.

This commit is contained in:
Phil Nash 2017-06-21 09:40:52 +01:00
parent c43d5f673f
commit e0c6c4aee7

View File

@ -74,7 +74,7 @@ namespace Catch {
return ParserResult::ok( ParseResultType::Matched ); return ParserResult::ok( ParseResultType::Matched );
}; };
auto cli auto cli1
= ExeName( config.processName ) = ExeName( config.processName )
+ Help( config.showHelp ) + Help( config.showHelp )
+ Opt( config.listTests ) + Opt( config.listTests )
@ -94,8 +94,10 @@ namespace Catch {
( "skip exception tests" ) ( "skip exception tests" )
+ Opt( config.showInvisibles ) + Opt( config.showInvisibles )
["-i"]["--invisibles"] ["-i"]["--invisibles"]
( "show invisibles (tabs, newlines)" ) ( "show invisibles (tabs, newlines)" );
+ Opt( config.outputFilename, "filename" )
auto cli2
= Opt( config.outputFilename, "filename" )
["-o"]["--out"] ["-o"]["--out"]
( "output filename" ) ( "output filename" )
+ Opt( config.reporterNames, "name" ) + Opt( config.reporterNames, "name" )
@ -118,8 +120,10 @@ namespace Catch {
( "show test durations" ) ( "show test durations" )
+ Opt( loadTestNamesFromFile, "filename" ) + Opt( loadTestNamesFromFile, "filename" )
["-f"]["--input-file"] ["-f"]["--input-file"]
( "load test names to run from a file" ) ( "load test names to run from a file" );
+ Opt( config.filenamesAsTags )
auto cli3
= Opt( config.filenamesAsTags )
["-#"]["--filenames-as-tags"] ["-#"]["--filenames-as-tags"]
( "adds a tag for the filename" ) ( "adds a tag for the filename" )
+ Opt( config.sectionsToRun, "section name" ) + Opt( config.sectionsToRun, "section name" )
@ -144,7 +148,8 @@ namespace Catch {
+ Arg( config.testsOrTags, "test name|pattern|tags" ) + Arg( config.testsOrTags, "test name|pattern|tags" )
( "which test or tests to use" ); ( "which test or tests to use" );
return cli; // Assemble from smaller parsers because some VS versions give ICEs otherwise
return cli1 + cli2 + cli3;
} }
} // end namespace Catch } // end namespace Catch