From e0c6c4aee7f22e8a47dbe07cd497d2e5fd5fe205 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 21 Jun 2017 09:40:52 +0100 Subject: [PATCH] Another attempt to fix VS ICEs - split cli parser up. --- include/internal/catch_commandline.hpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index ea2d7e45..66359a11 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -74,7 +74,7 @@ namespace Catch { return ParserResult::ok( ParseResultType::Matched ); }; - auto cli + auto cli1 = ExeName( config.processName ) + Help( config.showHelp ) + Opt( config.listTests ) @@ -94,8 +94,10 @@ namespace Catch { ( "skip exception tests" ) + Opt( config.showInvisibles ) ["-i"]["--invisibles"] - ( "show invisibles (tabs, newlines)" ) - + Opt( config.outputFilename, "filename" ) + ( "show invisibles (tabs, newlines)" ); + + auto cli2 + = Opt( config.outputFilename, "filename" ) ["-o"]["--out"] ( "output filename" ) + Opt( config.reporterNames, "name" ) @@ -118,8 +120,10 @@ namespace Catch { ( "show test durations" ) + Opt( loadTestNamesFromFile, "filename" ) ["-f"]["--input-file"] - ( "load test names to run from a file" ) - + Opt( config.filenamesAsTags ) + ( "load test names to run from a file" ); + + auto cli3 + = Opt( config.filenamesAsTags ) ["-#"]["--filenames-as-tags"] ( "adds a tag for the filename" ) + Opt( config.sectionsToRun, "section name" ) @@ -144,7 +148,8 @@ namespace Catch { + Arg( config.testsOrTags, "test name|pattern|tags" ) ( "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