diff --git a/tools/test/examples/examples.py b/tools/test/examples/examples.py index d3d698152d..5974633630 100644 --- a/tools/test/examples/examples.py +++ b/tools/test/examples/examples.py @@ -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) diff --git a/tools/test/examples/examples_lib.py b/tools/test/examples/examples_lib.py index 89e488a8a5..145ccec36d 100644 --- a/tools/test/examples/examples_lib.py +++ b/tools/test/examples/examples_lib.py @@ -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")