Skip to content

Commit fbce4e1

Browse files
authored
Merge pull request #2853 from bridadan/examples-toolchain-filtering
[Tests] Example build toolchain filtering
2 parents 48ac4ae + 1448aa5 commit fbce4e1

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

tools/test/examples/examples.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
{"features": ["IPV6"]},
99
"https://github.com/ARMmbed/mbed-os-example-client" : {"features": ["IPV6"]},
1010
"https://github.com/ARMmbed/mbed-os-example-sockets" : {"features": ["IPV6"]},
11-
"https://github.com/ARMmbed/mbed-os-example-uvisor" : {"targets": ["K64F"]}
11+
"https://github.com/ARMmbed/mbed-os-example-uvisor" : {"targets": ["K64F"], "toolchains":["GCC_ARM"]}
1212
}

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)