Skip to content

Commit eb11561

Browse files
committed
Add smoke test that builds example programs with mbed-cli
1 parent 22acfbf commit eb11561

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tools/test/examples.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
""" import and bulid a bunch of example programs """
2+
3+
import os
4+
import os.path
5+
import subprocess
6+
7+
8+
EXAMPLES = [
9+
"https://developer.mbed.org/teams/mbed/code/mbed_blinky"
10+
]
11+
12+
BUILD_TOOLCHAINS = [
13+
"ARM",
14+
"GCC_ARM",
15+
"IAR",
16+
]
17+
18+
BUILD_TARGETS = [
19+
"K64F"
20+
]
21+
22+
def main():
23+
"""Entry point"""
24+
for example in EXAMPLES:
25+
subprocess.call(["mbed-cli", "import", example])
26+
os.chdir(os.path.basename(example))
27+
for toolchain in BUILD_TOOLCHAINS:
28+
for target in BUILD_TARGETS:
29+
subprocess.Popen(["mbed-cli", "compile", "-t", toolchain, "-m",
30+
target]).wait()
31+
os.chdir("..")
32+
33+
if __name__ == "__main__":
34+
main()

0 commit comments

Comments
 (0)