Skip to content

Commit 65ada92

Browse files
authored
Merge pull request #10301 from alekla01/examples-verbose-patch-1
examples test compile optional verbose
2 parents d9463ee + 8137974 commit 65ada92

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

tools/test/examples/examples.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ def main():
7777
help=("build profile file"),
7878
metavar="profile")
7979

80+
compile_cmd.add_argument("-v", "--verbose",
81+
action="store_true",
82+
dest="verbose",
83+
default=False,
84+
help="Verbose diagnostic output")
85+
8086
export_cmd = subparsers.add_parser("export")
8187
export_cmd.set_defaults(fn=do_export),
8288
export_cmd.add_argument(
@@ -131,8 +137,7 @@ def do_deploy(_, config, examples):
131137
def do_compile(args, config, examples):
132138
"""Do the compile step"""
133139
results = {}
134-
results = lib.compile_repos(config, args.toolchains, args.mcu, args.profile, examples)
135-
140+
results = lib.compile_repos(config, args.toolchains, args.mcu, args.profile, args.verbose, examples)
136141
lib.print_summary(results)
137142
failures = lib.get_num_failures(results)
138143
print("Number of failures = %d" % failures)

tools/test/examples/examples_lib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def status(message):
347347
return results
348348

349349

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

396396
if profile:
397397
build_command.append("--profile")

0 commit comments

Comments
 (0)