Skip to content

Add app config switch #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions mbed/mbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -1987,9 +1987,10 @@ def status_(ignore=False):
dict(name=['-c', '--clean'], action='store_true', help='Clean the build directory before compiling'),
dict(name=['-N', '--artifact-name'], help='Name of the built program or library'),
dict(name=['-S', '--supported'], dest='supported', action='store_true', help='Shows supported matrix of targets and toolchains'),
dict(name='--app-config', dest="app_config", help="Path of an app configuration file (Default is to look for 'mbed_app.json')"),
help='Compile code using the mbed build tools',
description=("Compile this program using the mbed build tools."))
def compile_(toolchain=None, target=None, options=False, compile_library=False, compile_config=False, config_prefix=None, source=False, build=False, clean=False, artifact_name=None, supported=False):
def compile_(toolchain=None, target=None, options=False, compile_library=False, compile_config=False, config_prefix=None, source=False, build=False, clean=False, artifact_name=None, supported=False, app_config=None):
# Gather remaining arguments
args = remainder
# Find the root of the program
Expand All @@ -2010,6 +2011,7 @@ def compile_(toolchain=None, target=None, options=False, compile_library=False,
if supported:
popen(['python', '-u', os.path.join(tools_dir, 'make.py')]
+ (['-S'] if supported else []) + (['-v'] if very_verbose else [])
+ (['--app-config', app_config] if app_config else [])
+ args,
env=env)
return
Expand Down Expand Up @@ -2056,6 +2058,7 @@ def compile_(toolchain=None, target=None, options=False, compile_library=False,
+ ['--build', build]
+ (['-c'] if clean else [])
+ (['--artifact-name', artifact_name] if artifact_name else [])
+ (['--app-config', app_config] if app_config else [])
+ (['-v'] if verbose else [])
+ args,
env=env)
Expand All @@ -2077,9 +2080,10 @@ def compile_(toolchain=None, target=None, options=False, compile_library=False,
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'),
dict(name=['-c', '--clean'], action='store_true', help='Clean the build directory before compiling'),
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)"),
dict(name='--app-config', dest="app_config", help="Path of an app configuration file (Default is to look for 'mbed_app.json')"),
help='Find, build and run tests',
description=("Find, build, and run tests in a program and libraries"))
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):
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):
# Gather remaining arguments
args = remainder
# Find the root of the program
Expand Down Expand Up @@ -2121,6 +2125,7 @@ def test_(toolchain=None, target=None, compile_list=False, run_list=False, compi
+ list(chain.from_iterable(izip(repeat('--source'), source)))
+ (['-n', tests_by_name] if tests_by_name else [])
+ (['-v'] if verbose else [])
+ (['--app-config', app_config] if app_config else [])
+ args,
env=env)

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

if run_list:
popen(['mbedgt', '--test-spec', test_spec, '--list']
+ (['-n', tests_by_name] if tests_by_name else [])
+ (['-V'] if verbose else [])
+ (['--app-config', app_config] if app_config else [])
+ args,
env=env)

if run_only or build_and_run_tests:
popen(['mbedgt', '--test-spec', test_spec]
+ (['-n', tests_by_name] if tests_by_name else [])
+ (['-V'] if verbose else [])
+ (['--app-config', app_config] if app_config else [])
+ args,
env=env)

Expand Down