mirror of https://github.com/ARMmbed/mbed-os.git
Correctly filtering examples in test script.
If an example's GitHub repository contains multiple child examples, the script was incorrectly filtering out all the child examples when compiling and exporting. This patch now handles this case correctly.pull/3450/head
parent
315d893e83
commit
134d7743c3
|
@ -10,6 +10,7 @@ import os.path
|
|||
import sys
|
||||
import subprocess
|
||||
from shutil import rmtree
|
||||
from sets import Set
|
||||
|
||||
ROOT = abspath(dirname(dirname(dirname(dirname(__file__)))))
|
||||
sys.path.insert(0, ROOT)
|
||||
|
@ -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 = []
|
||||
|
@ -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 = []
|
||||
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue