Skip to content

Commit 7573f36

Browse files
committed
Add app config switch
1 parent e9dbe09 commit 7573f36

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mbed/mbed.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2077,9 +2077,10 @@ def compile_(toolchain=None, target=None, options=False, compile_library=False,
20772077
dict(name=['-o', '--options'], action='append', help='Compile options. Examples: "debug-info": generate debugging information; "small-build" to use microlib/nanolib, but limit RTOS to single thread; "save-asm": save the asm generated by the compiler'),
20782078
dict(name=['-c', '--clean'], action='store_true', help='Clean the build directory before compiling'),
20792079
dict(name='--test-spec', dest="test_spec", help="Path used for the test spec file used when building and running tests (the default path is the build directory)"),
2080+
dict(name='--app-config', dest="app_config", help="Path of an app configuration file (Default is to look for 'mbed_app.json')"),
20802081
help='Find, build and run tests',
20812082
description=("Find, build, and run tests in a program and libraries"))
2082-
def test_(toolchain=None, target=None, compile_list=False, run_list=False, compile_only=False, run_only=False, tests_by_name=None, source=False, options=False, build=False, clean=False, test_spec=None):
2083+
def test_(toolchain=None, target=None, compile_list=False, run_list=False, compile_only=False, run_only=False, tests_by_name=None, source=False, options=False, build=False, clean=False, test_spec=None, app_config=None):
20832084
# Gather remaining arguments
20842085
args = remainder
20852086
# Find the root of the program
@@ -2121,6 +2122,7 @@ def test_(toolchain=None, target=None, compile_list=False, run_list=False, compi
21212122
+ list(chain.from_iterable(izip(repeat('--source'), source)))
21222123
+ (['-n', tests_by_name] if tests_by_name else [])
21232124
+ (['-v'] if verbose else [])
2125+
+ (['--app-config', app_config] if app_config else [])
21242126
+ args,
21252127
env=env)
21262128

@@ -2135,20 +2137,23 @@ def test_(toolchain=None, target=None, compile_list=False, run_list=False, compi
21352137
+ ['--test-spec', test_spec]
21362138
+ (['-n', tests_by_name] if tests_by_name else [])
21372139
+ (['-v'] if verbose else [])
2140+
+ (['--app-config', app_config] if app_config else [])
21382141
+ args,
21392142
env=env)
21402143

21412144
if run_list:
21422145
popen(['mbedgt', '--test-spec', test_spec, '--list']
21432146
+ (['-n', tests_by_name] if tests_by_name else [])
21442147
+ (['-V'] if verbose else [])
2148+
+ (['--app-config', app_config] if app_config else [])
21452149
+ args,
21462150
env=env)
21472151

21482152
if run_only or build_and_run_tests:
21492153
popen(['mbedgt', '--test-spec', test_spec]
21502154
+ (['-n', tests_by_name] if tests_by_name else [])
21512155
+ (['-V'] if verbose else [])
2156+
+ (['--app-config', app_config] if app_config else [])
21522157
+ args,
21532158
env=env)
21542159

0 commit comments

Comments
 (0)