Skip to content

Correctly filtering examples in test script #3450

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 1 commit into from
Dec 19, 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
13 changes: 10 additions & 3 deletions tools/test/examples/examples_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import sys
import subprocess
from shutil import rmtree
from sets import Set

ROOT = abspath(dirname(dirname(dirname(dirname(__file__)))))
sys.path.insert(0, ROOT)
Expand Down Expand Up @@ -250,11 +251,13 @@ def export_repos(config, ides, targets, examples):
ides - List of IDES to export to
"""
results = {}
valid_examples = Set(examples)
print("\nExporting example repos....\n")
for example in config['examples']:
if example['name'] not in examples:
example_names = [basename(x['repo']) for x in get_repo_list(example)]
common_examples = valid_examples.intersection(Set(example_names))
if not common_examples:
continue

export_failures = []
build_failures = []
build_skips = []
Expand Down Expand Up @@ -331,9 +334,12 @@ def compile_repos(config, toolchains, targets, examples):

"""
results = {}
valid_examples = Set(examples)
print("\nCompiling example repos....\n")
for example in config['examples']:
if example['name'] not in examples:
example_names = [basename(x['repo']) for x in get_repo_list(example)]
common_examples = valid_examples.intersection(Set(example_names))
if not common_examples:
continue
failures = []
successes = []
Expand All @@ -349,6 +355,7 @@ def compile_repos(config, toolchains, targets, examples):
for target, toolchain in target_cross_toolchain(valid_choices(example['targets'], targets),
valid_choices(example['toolchains'], toolchains),
example['features']):
print("Compiling %s for %s, %s" % (name, target, toolchain))
proc = subprocess.Popen(["mbed-cli", "compile", "-t", toolchain,
"-m", target, "--silent"])
proc.wait()
Expand Down