Skip to content

Commit

Permalink
Merge pull request ARMmbed#3450 from bridadan/fix_example_filtering
Browse files Browse the repository at this point in the history
Correctly filtering examples in test script
  • Loading branch information
adbridge committed Dec 19, 2016
2 parents f2ce7eb + 134d774 commit 1cc1891
Showing 1 changed file with 10 additions and 3 deletions.
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

0 comments on commit 1cc1891

Please sign in to comment.