Skip to content

Commit c231939

Browse files
committed
[Exporter tests] conditional intersection for targets
1 parent 4e2d3c4 commit c231939

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tools/test/examples/examples_lib.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@ def print_summary(results, export=False):
7575

7676
print("#")
7777
print("#"*80)
78-
78+
79+
def valid_targets(allowed_targets, targets):
80+
if len(allowed_targets) > 0:
81+
return [t for t in targets if t in allowed_targets]
82+
else:
83+
return targets
84+
7985

8086
def target_cross_toolchain(allowed_toolchains,
8187
features=[], targets=[]):
@@ -272,7 +278,7 @@ def export_repos(config, ides, targets, examples):
272278
# list of valid combinations to work through
273279
for target, ide in target_cross_ide(ides,
274280
example['features'],
275-
example['targets'] or targets):
281+
valid_targets(example['targets'],targets)):
276282
example_name = "{} {} {}".format(example_project_name, target,
277283
ide)
278284
def status(message):
@@ -354,7 +360,7 @@ def compile_repos(config, toolchains, targets, examples):
354360
# list of valid combinations to work through
355361
for target, toolchain in target_cross_toolchain(toolchains,
356362
example['features'],
357-
example['targets'] or targets):
363+
valid_targets(example['targets'],targets)):
358364
proc = subprocess.Popen(["mbed-cli", "compile", "-t", toolchain,
359365
"-m", target, "--silent"])
360366
proc.wait()

0 commit comments

Comments
 (0)