Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

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

Commit
e0c6c4aee7f22e8a47dbe07cd497d2e5fd5fe205
Author
Phil Nash ·
Parents
c43d5f673fe7

Files · Download .tar.gz

Changes

 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