Skip to content

Commit c71e81b

Browse files
committed
Merge pull request #122 from bridadan/test-script-macros
Adding macro option to test.py script
2 parents 12deb25 + d676b19 commit c71e81b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

tools/test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
# Parse Options
3838
parser = get_default_options_parser()
3939

40+
parser.add_option("-D", "",
41+
action="append",
42+
dest="macros",
43+
help="Add a macro definition")
44+
4045
parser.add_option("-j", "--jobs",
4146
type="int",
4247
dest="jobs",
@@ -133,6 +138,7 @@
133138
report=build_report,
134139
properties=build_properties,
135140
name="mbed-os",
141+
macros=options.macros,
136142
archive=False)
137143

138144
# Build all the tests
@@ -141,6 +147,7 @@
141147
clean=options.clean,
142148
report=build_report,
143149
properties=build_properties,
150+
macros=options.macros,
144151
jobs=options.jobs)
145152

146153
# If a path to a test spec is provided, write it to a file

tools/test_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2027,7 +2027,7 @@ def print_tests(tests, format="list"):
20272027

20282028
def build_tests(tests, base_source_paths, build_path, target, toolchain_name,
20292029
options=None, clean=False, notify=None, verbose=False, jobs=1,
2030-
silent=False, report=None, properties=None):
2030+
macros=None, silent=False, report=None, properties=None):
20312031
"""Given the data structure from 'find_tests' and the typical build parameters,
20322032
build all the tests and return a test build data structure"""
20332033

@@ -2047,6 +2047,7 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name,
20472047
options=options,
20482048
jobs=jobs,
20492049
clean=clean,
2050+
macros=macros,
20502051
name=test_name,
20512052
report=report,
20522053
properties=properties,

0 commit comments

Comments
 (0)