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/3510/head
parent
abd9014853
commit
de0b95657d
|
@ -10,6 +10,7 @@ import os.path
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
from shutil import rmtree
|
from shutil import rmtree
|
||||||
|
from sets import Set
|
||||||
|
|
||||||
ROOT = abspath(dirname(dirname(dirname(dirname(__file__)))))
|
ROOT = abspath(dirname(dirname(dirname(dirname(__file__)))))
|
||||||
sys.path.insert(0, ROOT)
|
sys.path.insert(0, ROOT)
|
||||||
|
@ -250,11 +251,13 @@ def export_repos(config, ides, targets, examples):
|
||||||
ides - List of IDES to export to
|
ides - List of IDES to export to
|
||||||
"""
|
"""
|
||||||
results = {}
|
results = {}
|
||||||
|
valid_examples = Set(examples)
|
||||||
print("\nExporting example repos....\n")
|
print("\nExporting example repos....\n")
|
||||||
for example in config['examples']:
|
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
|
continue
|
||||||
|
|
||||||
export_failures = []
|
export_failures = []
|
||||||
build_failures = []
|
build_failures = []
|
||||||
build_skips = []
|
build_skips = []
|
||||||
|
@ -331,9 +334,12 @@ def compile_repos(config, toolchains, targets, examples):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
results = {}
|
results = {}
|
||||||
|
valid_examples = Set(examples)
|
||||||
print("\nCompiling example repos....\n")
|
print("\nCompiling example repos....\n")
|
||||||
for example in config['examples']:
|
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
|
continue
|
||||||
failures = []
|
failures = []
|
||||||
successes = []
|
successes = []
|
||||||
|
@ -349,6 +355,7 @@ def compile_repos(config, toolchains, targets, examples):
|
||||||
for target, toolchain in target_cross_toolchain(valid_choices(example['targets'], targets),
|
for target, toolchain in target_cross_toolchain(valid_choices(example['targets'], targets),
|
||||||
valid_choices(example['toolchains'], toolchains),
|
valid_choices(example['toolchains'], toolchains),
|
||||||
example['features']):
|
example['features']):
|
||||||
|
print("Compiling %s for %s, %s" % (name, target, toolchain))
|
||||||
proc = subprocess.Popen(["mbed-cli", "compile", "-t", toolchain,
|
proc = subprocess.Popen(["mbed-cli", "compile", "-t", toolchain,
|
||||||
"-m", target, "--silent"])
|
"-m", target, "--silent"])
|
||||||
proc.wait()
|
proc.wait()
|
||||||
|
|
Loading…
Reference in New Issue