Fixed single header generator for generating no-impl header

This commit is contained in:
Phil Nash 2014-06-02 07:47:24 +01:00
parent 7f1156d477
commit b198856f79

View File

@ -14,7 +14,7 @@ guardParser = re.compile( r'\s*#.*TWOBLUECUBES_CATCH_.*_INCLUDED')
defineParser = re.compile( r'\s*#define') defineParser = re.compile( r'\s*#define')
ifParser = re.compile( r'\s*#ifndef TWOBLUECUBES_CATCH_.*_INCLUDED') ifParser = re.compile( r'\s*#ifndef TWOBLUECUBES_CATCH_.*_INCLUDED')
endIfParser = re.compile( r'\s*#endif // 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*/\*') commentParser1 = re.compile( r'^\s*/\*')
commentParser2 = re.compile( r'^\s*\*') commentParser2 = re.compile( r'^\s*\*')
blankParser = re.compile( r'^\s*$') blankParser = re.compile( r'^\s*$')
@ -59,6 +59,8 @@ def parseFile( path, filename ):
ifdefs = ifdefs + 1 ifdefs = ifdefs + 1
elif endIfParser.match( line ): elif endIfParser.match( line ):
ifdefs = ifdefs - 1 ifdefs = ifdefs - 1
if ifdefs == implIfDefs:
implIfDefs = -1
m = includesParser.match( line ) m = includesParser.match( line )
if m: if m:
header = m.group(1) header = m.group(1)