mirror of https://github.com/ARMmbed/mbed-os.git
Use json for the example to target mapping and print failures
parent
eb11561c1f
commit
95ee4f6370
|
@ -0,0 +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"]
|
||||||
|
}
|
|
@ -2,12 +2,13 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import json
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES = [
|
EXAMPLES = json.load(open(os.path.join(os.path.dirname(__file__),
|
||||||
"https://developer.mbed.org/teams/mbed/code/mbed_blinky"
|
"examples.json")))
|
||||||
]
|
|
||||||
|
|
||||||
BUILD_TOOLCHAINS = [
|
BUILD_TOOLCHAINS = [
|
||||||
"ARM",
|
"ARM",
|
||||||
|
@ -15,20 +16,28 @@ BUILD_TOOLCHAINS = [
|
||||||
"IAR",
|
"IAR",
|
||||||
]
|
]
|
||||||
|
|
||||||
BUILD_TARGETS = [
|
|
||||||
"K64F"
|
|
||||||
]
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Entry point"""
|
"""Entry point"""
|
||||||
for example in EXAMPLES:
|
failures = []
|
||||||
|
for example, build_targets in EXAMPLES.iteritems():
|
||||||
subprocess.call(["mbed-cli", "import", example])
|
subprocess.call(["mbed-cli", "import", example])
|
||||||
os.chdir(os.path.basename(example))
|
os.chdir(os.path.basename(example))
|
||||||
for toolchain in BUILD_TOOLCHAINS:
|
for toolchain in BUILD_TOOLCHAINS:
|
||||||
for target in BUILD_TARGETS:
|
for target in build_targets:
|
||||||
subprocess.Popen(["mbed-cli", "compile", "-t", toolchain, "-m",
|
proc = subprocess.Popen(["mbed-cli", "compile", "-t",
|
||||||
target]).wait()
|
toolchain, "-m", target])
|
||||||
|
proc.wait()
|
||||||
|
if proc.returncode:
|
||||||
|
failures.append("{} {} {}".format(example, target,
|
||||||
|
toolchain))
|
||||||
os.chdir("..")
|
os.chdir("..")
|
||||||
|
if failures:
|
||||||
|
print("#"*80)
|
||||||
|
print("# Failed example combinations")
|
||||||
|
print("#")
|
||||||
|
for fail in failures:
|
||||||
|
print(fail)
|
||||||
|
return len(failures)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
sys.exit(main())
|
||||||
|
|
Loading…
Reference in New Issue