From d676b19105c33533a56e5f8056e146d7998e3ab7 Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Mon, 23 May 2016 10:49:58 -0500 Subject: [PATCH] Adding macro option to test.py script --- tools/test.py | 7 +++++++ tools/test_api.py | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/test.py b/tools/test.py index f9f659c554..f74f47c3bb 100644 --- a/tools/test.py +++ b/tools/test.py @@ -37,6 +37,11 @@ if __name__ == '__main__': # Parse Options parser = get_default_options_parser() + parser.add_option("-D", "", + action="append", + dest="macros", + help="Add a macro definition") + parser.add_option("-j", "--jobs", type="int", dest="jobs", @@ -133,6 +138,7 @@ if __name__ == '__main__': report=build_report, properties=build_properties, name="mbed-os", + macros=options.macros, archive=False) # Build all the tests @@ -141,6 +147,7 @@ if __name__ == '__main__': clean=options.clean, report=build_report, properties=build_properties, + macros=options.macros, jobs=options.jobs) # If a path to a test spec is provided, write it to a file diff --git a/tools/test_api.py b/tools/test_api.py index 812d5667d3..44a88e45b1 100644 --- a/tools/test_api.py +++ b/tools/test_api.py @@ -2027,7 +2027,7 @@ def print_tests(tests, format="list"): def build_tests(tests, base_source_paths, build_path, target, toolchain_name, options=None, clean=False, notify=None, verbose=False, jobs=1, - silent=False, report=None, properties=None): + macros=None, silent=False, report=None, properties=None): """Given the data structure from 'find_tests' and the typical build parameters, build all the tests and return a test build data structure""" @@ -2047,6 +2047,7 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name, options=options, jobs=jobs, clean=clean, + macros=macros, name=test_name, report=report, properties=properties,