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

Fixed single header generator for generating no-impl header

Commit
b198856f7941a9a1135ee3f8f9973b057a279ff9
Author
Phil Nash ·
Parents
7f1156d477b6

Files · Download .tar.gz

Changes

 scripts/generateSingleHeader.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/generateSingleHeader.py b/scripts/generateSingleHeader.py
index dda16305..9f5ddcb0 100644
--- a/scripts/generateSingleHeader.py
+++ b/scripts/generateSingleHeader.py
@@ -14,7 +14,7 @@ guardParser = re.compile( r'\s*#.*TWOBLUECUBES_CATCH_.*_INCLUDED')
 defineParser = re.compile( r'\s*#define')
 ifParser = re.compile( r'\s*#ifndef TWOBLUECUBES_CATCH_.*_INCLUDED')
 endIfParser = re.compile( r'\s*#endif // TWOBLUECUBES_CATCH_.*_INCLUDED')
-ifImplParser = re.compile( r'\s*#if.*(CATCH_CONFIG_MAIN|CATCH_CONFIG_RUNNER)')
+ifImplParser = re.compile( r'\s*#ifdef CATCH_CONFIG_RUNNER' )
 commentParser1 = re.compile( r'^\s*/\*')
 commentParser2 = re.compile( r'^\s*\*')
 blankParser = re.compile( r'^\s*$')
@@ -59,6 +59,8 @@ def parseFile( path, filename ):
             ifdefs = ifdefs + 1
         elif endIfParser.match( line ):
             ifdefs = ifdefs - 1
+            if ifdefs == implIfDefs:
+                implIfDefs = -1
         m = includesParser.match( line )
         if m:
             header = m.group(1)