From b198856f7941a9a1135ee3f8f9973b057a279ff9 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 2 Jun 2014 07:47:24 +0100 Subject: [PATCH] Fixed single header generator for generating no-impl header --- 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)