mirror of https://github.com/ARMmbed/mbed-os.git
Move to feature filter for target and toolchain detection; print passed tests
parent
78028a9ceb
commit
f7a1d1f749
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"https://developer.mbed.org/teams/mbed/code/mbed_blinky" : ["K64F"],
|
||||
"https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-ble-Beacon" : ["NRF51_DK"],
|
||||
"https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-ble-HeartRate" : ["NRF51_DK"],
|
||||
"https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-mesh-minimal" :["K64F"],
|
||||
"https://github.com/ARMmbed/mbed-os-example-client" : ["K64F"],
|
||||
"https://github.com/ARMmbed/mbed-os-example-sockets" : ["K64F", "VK_RZ_A1H", "LPC1768"]
|
||||
"https://developer.mbed.org/teams/mbed/code/mbed_blinky" : [],
|
||||
"https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-ble-Beacon" : ["BLE"],
|
||||
"https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-ble-HeartRate" : ["BLE"],
|
||||
"https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-mesh-minimal" :["IPV4"],
|
||||
"https://github.com/ARMmbed/mbed-os-example-client" : ["IPV4"],
|
||||
"https://github.com/ARMmbed/mbed-os-example-sockets" : ["IPV4"]
|
||||
}
|
||||
|
|
|
@ -1,42 +1,55 @@
|
|||
""" import and bulid a bunch of example programs """
|
||||
|
||||
import os
|
||||
from os.path import dirname, abspath, basename
|
||||
import os.path
|
||||
import sys
|
||||
import subprocess
|
||||
import json
|
||||
|
||||
ROOT = abspath(dirname(dirname(dirname(dirname(__file__)))))
|
||||
sys.path.insert(0, ROOT)
|
||||
|
||||
from tools.build_api import get_mbed_official_release
|
||||
from tools.targets import TARGET_MAP
|
||||
|
||||
|
||||
EXAMPLES = json.load(open(os.path.join(os.path.dirname(__file__),
|
||||
"examples.json")))
|
||||
|
||||
BUILD_TOOLCHAINS = [
|
||||
"ARM",
|
||||
"GCC_ARM",
|
||||
"IAR",
|
||||
]
|
||||
def print_stuff(name, lst):
|
||||
if list:
|
||||
print("#"*80)
|
||||
print("# {} example combinations".format(name))
|
||||
print("#")
|
||||
for thing in lst:
|
||||
print(thing)
|
||||
|
||||
|
||||
def main():
|
||||
"""Entry point"""
|
||||
failures = []
|
||||
for example, build_targets in EXAMPLES.iteritems():
|
||||
sucesses = []
|
||||
for example, build_features in EXAMPLES.iteritems():
|
||||
subprocess.call(["mbed-cli", "import", example])
|
||||
os.chdir(os.path.basename(example))
|
||||
for toolchain in BUILD_TOOLCHAINS:
|
||||
for target in build_targets:
|
||||
os.chdir(basename(example))
|
||||
for target, toolchains in [(target, toolchains) for target, toolchains
|
||||
in get_mbed_official_release("5") if
|
||||
all(feature in TARGET_MAP[target].features
|
||||
for feature in build_features)]:
|
||||
for toolchain in toolchains:
|
||||
proc = subprocess.Popen(["mbed-cli", "compile", "-t",
|
||||
toolchain, "-m", target])
|
||||
proc.wait()
|
||||
example_name = "{} {} {}".format(basename(example), target,
|
||||
toolchain)
|
||||
if proc.returncode:
|
||||
failures.append("{} {} {}".format(example, target,
|
||||
toolchain))
|
||||
failures.append(example_name)
|
||||
else:
|
||||
sucesses.append(example_name)
|
||||
os.chdir("..")
|
||||
if failures:
|
||||
print("#"*80)
|
||||
print("# Failed example combinations")
|
||||
print("#")
|
||||
for fail in failures:
|
||||
print(fail)
|
||||
print_stuff("Passed", sucesses)
|
||||
print_stuff("Failed", failures)
|
||||
return len(failures)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Reference in New Issue