Skip to content

Commit b527ed3

Browse files
authored
Merge pull request cesanta#3204 from cesanta/tests
Moving tests from GH yaml to bash scripts and Makefiles
2 parents 4f9ebd8 + cd86559 commit b527ed3

5 files changed

Lines changed: 57 additions & 23 deletions

File tree

test/cube/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,23 @@ IMAGE ?= scaprile/cubeozone
77

88
all: $(PROJECTS)
99
$(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -removeAll workspace
10+
$(DOCKER) $(IMAGE) /bin/bash -c "rm -rf workspace/.metadata"
1011

1112
$(PROJECTS): FORCE
1213
(make -C $@ && sudo make -C $@ clean) || ( \
1314
COREDIRS=`find $@ -maxdepth 1 -name 'CM*' -print` && ( \
1415
(test "$$COREDIRS" = "" && \
1516
PROJNAME=`xq -r .projectDescription.name $@/.project` && \
16-
$(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -import $@ -cleanBuild $$PROJNAME/$(TARGET) ) || ( \
17+
$(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -import $@ -cleanBuild $$PROJNAME/$(TARGET) && \
18+
$(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -remove $@ && \
19+
$(DOCKER) $(IMAGE) /bin/bash -c "rm -rf $@/.settings $@/$(TARGET)") || ( \
1720
(test "$$COREDIRS" != "" && \
1821
for core in $$COREDIRS; do \
1922
DIR=`basename $$core` \
2023
PROJNAME=`xq -r .projectDescription.name $@/$$DIR/.project` && \
21-
$(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -import $@/$$DIR -cleanBuild $$PROJNAME/$(TARGET) || exit 1; \
24+
$(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -import $@/$$DIR -cleanBuild $$PROJNAME/$(TARGET) && \
25+
$(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -remove $@/$$DIR && \
26+
$(DOCKER) $(IMAGE) /bin/bash -c "rm -rf $@/$$DIR/.settings $@/$$DIR/Drivers $@/$$DIR/Middlewares $@/$$DIR/$(TARGET)" || exit 1; \
2227
done ))))
2328

2429
FORCE:

test/esp-idf/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ all: $(PROJECTS)
1111
$(PROJECTS): FORCE
1212
(make -C $@ build && make -C $@ clean) || ( \
1313
$(DOCKER) $(IMAGE) /bin/bash -c 'cd $@ && idf.py build' && \
14-
rm -rf build sdkconfig )
14+
$(DOCKER) $(IMAGE) /bin/bash -c 'rm -rf .cache && cd $@ && rm -rf build sdkconfig')
1515

1616
FORCE:

test/wizard/Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ ifeq "$(IDE)" "GCC+make"
66
BUILD = $(MAKE) -f ../gcc+make/Makefile PROJECTS=wizard
77
endif
88
ifeq "$(IDE)" "CubeIDE"
9-
BUILD = $(MAKE) -f ../cube/Makefile PROJECTS=wizard && rm -rf workspace
9+
BUILD = mkdir -p workspace && $(MAKE) -f ../cube/Makefile PROJECTS=wizard && rmdir workspace
1010
endif
1111
ifeq "$(IDE)" "MCUXpresso"
12-
BUILD = $(MAKE) -f ../xpresso/Makefile PROJECTS=wizard && rm -rf workspace
12+
BUILD = mkdir -p workspace && $(MAKE) -f ../xpresso/Makefile PROJECTS=wizard && rmdir workspace
1313
endif
14-
ifeq "$(IDE)" "Keil"
14+
ifeq "$(IDE)" "ModusIDE"
15+
BUILD = true
16+
endif
17+
ifeq "$(IDE)" "e2studio"
1518
BUILD = true
1619
endif
1720
ifeq "$(IDE)" "Pico-SDK"
@@ -20,6 +23,9 @@ endif
2023
ifeq "$(IDE)" "ESP-IDF"
2124
BUILD = $(MAKE) -f ../esp-idf/Makefile PROJECTS=wizard
2225
endif
26+
ifeq "$(IDE)" "Keil"
27+
BUILD = true
28+
endif
2329
ifeq "$(IDE)" "Arduino"
2430
BUILD = true
2531
endif
@@ -32,6 +38,7 @@ endif
3238

3339

3440
firmware.bin: wizard
41+
(test "$(BUILD)" == "true" && echo "NOT TESTING $(BOARD) $(IDE) $(RTOS): don't know how to test $(IDE) projects" >> test.log) || true
3542
$(BUILD) && rm -rf wizard*
3643

3744
wizard: FORCE

test/wizard/test.sh

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ done
2929
dotest h7s3l8 GCC+make baremetal
3030

3131

32-
NXP="mcxn947"
32+
NXP="rt1020 rt1024 rt1040 rt1060 rt1064 rt1170 mcxn947"
3333
NXPIDES="GCC+make MCUXpresso"
3434
for board in $NXP; do
3535
for ide in $NXPIDES; do
@@ -38,16 +38,9 @@ for board in $NXP; do
3838
done
3939
done
4040
done
41-
NXP="rt1020 rt1024 rt1040 rt1060 rt1064 rt1170"
41+
NXP="rw612"
4242
for board in $NXP; do
43-
dotest $board "GCC+make" "baremetal"
44-
done
45-
46-
47-
INFINEON="xmc4400 xmc4700 xmc7200"
48-
INFINEONIDES="GCC+make"
49-
for board in $INFINEON; do
50-
for ide in $INFINEONIDES; do
43+
for ide in $NXPIDES; do
5144
for rtos in "baremetal"; do
5245
dotest $board $ide $rtos
5346
done
@@ -67,6 +60,23 @@ done
6760
dotest "tms570" "CGT+make" "baremetal"
6861

6962

63+
INFINEON="xmc4400 xmc4700 xmc7200"
64+
INFINEONIDES="GCC+make ModusIDE"
65+
for board in $INFINEON; do
66+
for ide in $INFINEONIDES; do
67+
for rtos in "baremetal"; do
68+
dotest $board $ide $rtos
69+
done
70+
done
71+
done
72+
73+
74+
ESP="esp32"
75+
for board in $ESP; do
76+
dotest $board "ESP-IDF" "baremetal"
77+
done
78+
79+
7080
PICO="evb-pico evb-pico2 evb-pico2-w5100 pico-w pico2-w"
7181
for board in $PICO; do
7282
for rtos in "baremetal"; do
@@ -75,15 +85,23 @@ for board in $PICO; do
7585
done
7686

7787

78-
ESP="esp32"
79-
for board in $ESP; do
80-
dotest $board "ESP-IDF" "baremetal"
88+
#NORDIC
89+
90+
RENESAS="ra6 ra8m1"
91+
RENESASIDES="GCC+make e2studio"
92+
for board in $RENESAS; do
93+
for ide in $RENESASIDES; do
94+
for rtos in "baremetal"; do
95+
dotest $board $ide $rtos
96+
done
97+
done
8198
done
8299

100+
83101
# f439 not supported
84102
# h755 not supported in 3.7.0 branch; master branch currently not building
85103
# other ST boards (PHY address != 0) might build and not work
86-
ZEPHYR="zephyr zephyr-w5500 f207 f429 f746 f756 f767 h563 h573 h723 h735 h743 h745 h747 h753 mcxn947 rt1060 rt1064 evb-pico"
104+
ZEPHYR="zephyr zephyr-w5500 f207 f429 f746 f756 f767 h563 h573 h723 h735 h743 h745 h747 h753 mcxn947 rt1060 rt1064 evb-pico nrf91"
87105
for board in $ZEPHYR; do
88106
dotest $board "Zephyr" "baremetal"
89107
done

test/xpresso/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1+
# NXP command line tool is useless for this task, using Eclipse headless build
2+
13
ROOT ?= $(realpath $(CURDIR)/../..)
24
PROJECTS ?= $(wildcard ../../tutorials/nxp/*-xpresso-*)
35
TARGET ?= Debug
4-
DOCKER = docker run --rm -v $(ROOT):$(ROOT) -v $(CURDIR):/root -w $(CURDIR)
6+
DOCKER = docker run --rm --ulimit nofile=1024:524288 -v $(ROOT):$(ROOT) -v $(CURDIR):/root -w $(CURDIR)
57
IMAGE ?= scaprile/xpresso
68
HEADLESS_BUILD = /usr/local/mcuxpressoide/ide/mcuxpressoide --launcher.suppressErrors -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild
79

810
all: $(PROJECTS)
911
$(DOCKER) $(IMAGE) $(HEADLESS_BUILD) -data workspace -removeAll workspace
12+
$(DOCKER) $(IMAGE) /bin/bash -c "rm -rf workspace/.metadata workspace/.mcuxpressoide* workspace/.gitignore mcuxpresso .cache .p2 .eclipse"
1013

1114
$(PROJECTS): FORCE
1215
(make -C $@ && make -C $@ clean) || ( \
1316
PROJNAME=`xq -r .projectDescription.name $@/.project` && \
14-
($(DOCKER) $(IMAGE) $(HEADLESS_BUILD) -data workspace -import wizard -cleanBuild $$PROJNAME/$(TARGET) || true) && \
15-
test -f $(@F)/$(TARGET)/$$PROJNAME.axf )
17+
($(DOCKER) $(IMAGE) $(HEADLESS_BUILD) -data workspace -import $@ -cleanBuild $$PROJNAME/$(TARGET) || true) && \
18+
test -f $(@F)/$(TARGET)/$$PROJNAME.axf && \
19+
$(DOCKER) $(IMAGE) /bin/bash -c "find $@/$(TARGET) -mindepth 1 ! -name '*.ld' -exec rm -rf {} +")
1620

1721
FORCE:

0 commit comments

Comments
 (0)