diff --git a/tools/test.py b/tools/test.py index 072cb5efe3..64f6fc5810 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,