Skip to content
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

examples test compile optional verbose #10301

Merged
merged 2 commits into from Apr 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions tools/test/examples/examples.py
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tools/test/examples/examples_lib.py
Expand Up @@ -347,7 +347,7 @@ def status(message):
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:
Expand Down Expand Up @@ -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")
Expand Down