Skip to content

Commit 53ecfdb

Browse files
committed
Adding the ability to filter examples by toolchains
This change was driven by the fact that certain examples only support a subset of the toolchains.
1 parent b481da4 commit 53ecfdb

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tools/test/examples/examples.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def print_stuff(name, lst):
3232

3333

3434
def target_cross_toolchain(allowed_toolchains,
35-
features=[], targets=TARGET_MAP.keys()):
35+
features=[], targets=TARGET_MAP.keys(),
36+
toolchains=SUPPORTED_TOOLCHAINS):
3637
"""Generate pairs of target and toolchains
3738
3839
Args:
@@ -42,14 +43,16 @@ def target_cross_toolchain(allowed_toolchains,
4243
features - the features that must be in the features array of a
4344
target
4445
targets - a list of available targets
46+
toolchains - a list of available toolchains
4547
"""
46-
for target, toolchains in get_mbed_official_release("5"):
47-
for toolchain in toolchains:
48+
for release_target, release_toolchains in get_mbed_official_release("5"):
49+
for toolchain in release_toolchains:
4850
if (toolchain in allowed_toolchains and
49-
target in targets and
50-
all(feature in TARGET_MAP[target].features
51+
toolchain in toolchains and
52+
release_target in targets and
53+
all(feature in TARGET_MAP[release_target].features
5154
for feature in features)):
52-
yield target, toolchain
55+
yield release_target, toolchain
5356

5457

5558
def main():

0 commit comments

Comments
 (0)