Add smoke test that builds example programs with mbed-cli

pull/2576/head
Jimmy Brisson 2016-08-29 11:26:37 -05:00
parent 22acfbf077
commit eb11561c1f
1 changed files with 34 additions and 0 deletions

34
tools/test/examples.py Normal file
View File

@ -0,0 +1,34 @@
""" import and bulid a bunch of example programs """
import os
import os.path
import subprocess
EXAMPLES = [
"https://developer.mbed.org/teams/mbed/code/mbed_blinky"
]
BUILD_TOOLCHAINS = [
"ARM",
"GCC_ARM",
"IAR",
]
BUILD_TARGETS = [
"K64F"
]
def main():
"""Entry point"""
for example in EXAMPLES:
subprocess.call(["mbed-cli", "import", example])
os.chdir(os.path.basename(example))
for toolchain in BUILD_TOOLCHAINS:
for target in BUILD_TARGETS:
subprocess.Popen(["mbed-cli", "compile", "-t", toolchain, "-m",
target]).wait()
os.chdir("..")
if __name__ == "__main__":
main()