diff --git a/scripts/bench.py b/scripts/bench.py index b0f3dfe9..e17fe379 100755 --- a/scripts/bench.py +++ b/scripts/bench.py @@ -37,7 +37,7 @@ except ModuleNotFoundError: RUNNER_PATH = ['./runners/bench_runner'] -HEADER_PATH = 'runners/bench_runner.h' +HEADER_PATHS = ['./runners/bench_runner.h'] GDB_PATH = ['gdb'] GDB_SCRIPTS = ['./scripts/dbg.gdb.py'] @@ -383,7 +383,8 @@ def compile(bench_paths, **args): f.writeln() # include bench_runner.h in every generated file - f.writeln("#include \"%s\"" % args['include']) + for header in (args.get('include') or HEADER_PATHS): + f.writeln("#include \"%s\"" % header) f.writeln() # write out generated functions, this can end up in different @@ -1765,9 +1766,8 @@ if __name__ == "__main__": help="Source file to compile, possibly injecting internal benches.") comp_parser.add_argument( '--include', - default=HEADER_PATH, - help="Inject this header file into every compiled bench file. " - "Defaults to %r." % HEADER_PATH) + help="Inject these header files into every compiled bench file. " + "Defaults to %r." % HEADER_PATHS) comp_parser.add_argument( '-o', '--output', help="Output file.") diff --git a/scripts/test.py b/scripts/test.py index f7f757b2..0d2f2f1c 100755 --- a/scripts/test.py +++ b/scripts/test.py @@ -38,7 +38,7 @@ except ModuleNotFoundError: RUNNER_PATH = ['./runners/test_runner'] -HEADER_PATH = 'runners/test_runner.h' +HEADER_PATHS = ['./runners/test_runner.h'] GDB_PATH = ['gdb'] GDB_SCRIPTS = ['./scripts/dbg.gdb.py'] @@ -395,7 +395,8 @@ def compile(test_paths, **args): f.writeln() # include test_runner.h in every generated file - f.writeln("#include \"%s\"" % args['include']) + for header in (args.get('include') or HEADER_PATHS): + f.writeln("#include \"%s\"" % header) f.writeln() # write out generated functions, this can end up in different @@ -1800,9 +1801,8 @@ if __name__ == "__main__": help="Source file to compile, possibly injecting internal tests.") comp_parser.add_argument( '--include', - default=HEADER_PATH, - help="Inject this header file into every compiled test file. " - "Defaults to %r." % HEADER_PATH) + help="Inject these header files into every compiled test file. " + "Defaults to %r." % HEADER_PATHS) comp_parser.add_argument( '-o', '--output', help="Output file.")