Merge pull request #2853 from bridadan/examples-toolchain-filtering

[Tests] Example build toolchain filtering
pull/2828/merge
Sam Grove 2016-09-28 15:30:55 -07:00 committed by GitHub
commit fbce4e18b2
2 changed files with 10 additions and 7 deletions

View File

@ -8,5 +8,5 @@
{"features": ["IPV6"]},
"https://github.com/ARMmbed/mbed-os-example-client" : {"features": ["IPV6"]},
"https://github.com/ARMmbed/mbed-os-example-sockets" : {"features": ["IPV6"]},
"https://github.com/ARMmbed/mbed-os-example-uvisor" : {"targets": ["K64F"]}
"https://github.com/ARMmbed/mbed-os-example-uvisor" : {"targets": ["K64F"], "toolchains":["GCC_ARM"]}
}

View File

@ -32,7 +32,8 @@ SUPPORTED_TOOLCHAINS = ["ARM", "IAR", "GCC_ARM"]
def target_cross_toolchain(allowed_toolchains,
features=[], targets=TARGET_MAP.keys()):
features=[], targets=TARGET_MAP.keys(),
toolchains=SUPPORTED_TOOLCHAINS):
"""Generate pairs of target and toolchains
Args:
@ -42,14 +43,16 @@ def target_cross_toolchain(allowed_toolchains,
features - the features that must be in the features array of a
target
targets - a list of available targets
toolchains - a list of available toolchains
"""
for target, toolchains in get_mbed_official_release("5"):
for toolchain in toolchains:
for release_target, release_toolchains in get_mbed_official_release("5"):
for toolchain in release_toolchains:
if (toolchain in allowed_toolchains and
target in targets and
all(feature in TARGET_MAP[target].features
toolchain in toolchains and
release_target in targets and
all(feature in TARGET_MAP[release_target].features
for feature in features)):
yield target, toolchain
yield release_target, toolchain
def main():