Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def runTest(self):
from pcpp import CmdPreprocessor
p = CmdPreprocessor(['pcpp', '--time', '--passthru-comments',
'-o', 'tests/issue0037.i',
'tests/issue0037/inc.h'])
with open('tests/issue0037.i', 'rt') as ih:
output = ih.read()
if output != shouldbe:
print("Should be:\n" + shouldbe + "EOF\n", file = sys.stderr)
print("\nWas:\n" + output + "EOF\n", file = sys.stderr)
self.assertEqual(p.return_code, 0)
self.assertEqual(output, shouldbe)