Merge pull request #10301 from alekla01/examples-verbose-patch-1

examples test compile optional verbose
pull/10354/head
Martin Kojtal 2019-04-09 11:04:33 +02:00 committed by GitHub
commit 65ada92527
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -77,6 +77,12 @@ def main():
help=("build profile file"),
metavar="profile")
compile_cmd.add_argument("-v", "--verbose",
action="store_true",
dest="verbose",
default=False,
help="Verbose diagnostic output")
export_cmd = subparsers.add_parser("export")
export_cmd.set_defaults(fn=do_export),
export_cmd.add_argument(
@ -131,8 +137,7 @@ def do_deploy(_, config, examples):
def do_compile(args, config, examples):
"""Do the compile step"""
results = {}
results = lib.compile_repos(config, args.toolchains, args.mcu, args.profile, examples)
results = lib.compile_repos(config, args.toolchains, args.mcu, args.profile, args.verbose, examples)
lib.print_summary(results)
failures = lib.get_num_failures(results)
print("Number of failures = %d" % failures)

View File

@ -347,7 +347,7 @@ def export_repos(config, ides, targets, examples):
return results
def compile_repos(config, toolchains, targets, profile, examples):
def compile_repos(config, toolchains, targets, profile, verbose, examples):
"""Compiles combinations of example programs, targets and compile chains.
The results are returned in a [key: value] dictionary format:
@ -391,7 +391,7 @@ def compile_repos(config, toolchains, targets, profile, examples):
valid_choices(example['toolchains'], toolchains),
example['features']):
print("Compiling %s for %s, %s" % (name, target, toolchain))
build_command = ["mbed-cli", "compile", "-t", toolchain, "-m", target, "-v"]
build_command = ["mbed-cli", "compile", "-t", toolchain, "-m", target] + (['-v'] if verbose else [])
if profile:
build_command.append("--profile")