Skip to content

Commit 069254b

Browse files
authored
Merge pull request #2932 from cesanta/test
Add test Makefiles for IDEs and Wizard test script
2 parents 4be8aa0 + f3cd74c commit 069254b

File tree

7 files changed

+173
-12
lines changed

7 files changed

+173
-12
lines changed

test/cube/Makefile

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,8 @@ all: $(PROJECTS)
99
$(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -removeAll workspace
1010

1111
$(PROJECTS): FORCE
12-
(make -C $@ && sudo make -C $@ clean) || $(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -import $@ -cleanBuild $(@F)/$(TARGET)
12+
(make -C $@ && make -C $@ clean) || ( \
13+
PROJNAME=`xq -r .projectDescription.name $@/.project` && \
14+
$(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -import $@ -cleanBuild $$PROJNAME/$(TARGET) )
1315

1416
FORCE:
15-
16-
# Automated remote test. See https://vcon.io/automated-firmware-tests/
17-
URL ?= https://dash.vcon.io/api/v3/devices
18-
update: $(PROJECTS)
19-
curl --fail-with-body -su :$(VCON_API_KEY) $(URL)/$(DEVICE)/ota --data-binary @$</$(TARGET)/firmware.bin
20-
21-
test update: TARGET = Test
22-
test: update
23-
curl --fail-with-body -su :$(VCON_API_KEY) $(URL)/$(DEVICE)/tx?t=5 | tee /tmp/output.txt
24-
grep 'READY, IP:' /tmp/output.txt # Check for network init
25-
# grep 'MQTT connected' /tmp/output.txt # Check for MQTT connection success

test/esp-idf/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ROOT ?= $(realpath $(CURDIR)/../..)
2+
PROJECTS ?= $(wildcard ../../examples/esp32/*)
3+
TARGET ?= Debug
4+
DOCKER = docker run --rm -v $(ROOT):$(ROOT) -v $(CURDIR):/root -w $(CURDIR)
5+
IMAGE ?= espressif/idf
6+
7+
8+
all: $(PROJECTS)
9+
echo
10+
11+
$(PROJECTS): FORCE
12+
(make -C $@ build && make -C $@ clean) || ( \
13+
$(DOCKER) $(IMAGE) /bin/bash -c 'cd $@ && idf.py build' && \
14+
rm -rf build sdkconfig )
15+
16+
FORCE:

test/gcc+make/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
PROJECTS ?= $(wildcard ../../examples/*/*-make-*)
2+
3+
all: $(PROJECTS)
4+
echo
5+
6+
$(PROJECTS): FORCE
7+
$(MAKE) -C $@ build clean
8+
9+
FORCE:

test/pico-sdk/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
PROJECTS ?= $(wildcard ../../examples/rp2040/*-sdk-*)
2+
3+
all: $(PROJECTS)
4+
echo
5+
6+
$(PROJECTS): pico-sdk
7+
(make -C $@ build && make -C $@ clean) || ( \
8+
ln -s $(PWD)/pico-sdk $@/pico-sdk && \
9+
cd $@ && rm -rf build && mkdir -p build && \
10+
cd build && cmake -G "Unix Makefiles" .. && make && \
11+
rm -rf build pico-sdk )
12+
13+
pico-sdk:
14+
git clone --depth 1 -b 1.5.1 https://github.com/raspberrypi/pico-sdk $@
15+
cd $@ && git submodule update --init
16+
17+
clean:
18+
rm -rf pico-sdk

test/wizard/Makefile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
WIZARD_URL ?= http://mongoose.ws/wizard
2+
3+
all build example: firmware.bin
4+
5+
ifeq "$(IDE)" "GCC+make"
6+
BUILD = $(MAKE) -f ../gcc+make/Makefile PROJECTS=wizard
7+
endif
8+
ifeq "$(IDE)" "CubeIDE"
9+
BUILD = $(MAKE) -f ../cube/Makefile PROJECTS=wizard
10+
endif
11+
ifeq "$(IDE)" "MCUXpresso"
12+
BUILD = $(MAKE) -f ../xpresso/Makefile PROJECTS=wizard
13+
endif
14+
ifeq "$(IDE)" "Zephyr"
15+
BUILD = true
16+
endif
17+
ifeq "$(IDE)" "Keil"
18+
BUILD = true
19+
endif
20+
ifeq "$(IDE)" "Pico-SDK"
21+
BUILD = $(MAKE) -f ../pico-sdk/Makefile PROJECTS=wizard
22+
endif
23+
ifeq "$(IDE)" "ESP-IDF"
24+
BUILD = $(MAKE) -f ../esp-idf/Makefile PROJECTS=wizard
25+
endif
26+
ifeq "$(IDE)" "Arduino"
27+
BUILD = true
28+
endif
29+
30+
31+
firmware.bin: wizard
32+
$(BUILD) && rm -rf wizard*
33+
34+
wizard: FORCE
35+
hash=$$(curl -s -X POST -H "Content-Type: application/json" -d '{"build":{"board":"$(BOARD)","ide":"$(IDE)","rtos":"$(RTOS)"}}' $(WIZARD_URL)/api/hash | jq -r '.hash') \
36+
&& curl -s $(WIZARD_URL)/api/zip/$(BOARD)/$(IDE)/$(RTOS)/$$hash -o wizard.zip
37+
unzip wizard.zip
38+
39+
FORCE:

test/wizard/test.sh

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/bash
2+
3+
RTOSES="baremetal FreeRTOS"
4+
5+
6+
dotest ()
7+
{
8+
echo "BOARD=$1 IDE=$2 RTOS=$3" >> test.log
9+
make BOARD=$1 IDE=$2 RTOS=$3 || ( \
10+
echo "^^^ FAILED ^^^" >> test.log && rm -rf wizard* workspace )
11+
}
12+
13+
14+
cd `dirname "$0"`
15+
rm test.log
16+
17+
18+
STM32="f207 f429 f439 f746 f756 f767 h563 h573 h723 h735 h743 h745 h747 h753 h755"
19+
STIDES="GCC+make CubeIDE"
20+
# Zephyr: !f439
21+
# Keil: f756
22+
for board in $STM32; do
23+
for ide in $STIDES; do
24+
for rtos in $RTOSES; do
25+
dotest $board $ide $rtos
26+
done
27+
done
28+
done
29+
30+
31+
NXP="rt1020 rt1024 rt1040 rt1060 rt1064 rt1170 mcxn947"
32+
NXPIDES="GCC+make"
33+
#MCUXpresso: mcxn947
34+
for board in $NXP; do
35+
for ide in $NXPIDES; do
36+
for rtos in "baremetal"; do
37+
dotest $board $ide $rtos
38+
done
39+
done
40+
done
41+
42+
43+
INFINEON="xmc4400 xmc4700 xmc7200"
44+
INFINEONIDES="GCC+make"
45+
for board in $INFINEON; do
46+
for ide in $INFINEONIDES; do
47+
for rtos in "baremetal"; do
48+
dotest $board $ide $rtos
49+
done
50+
done
51+
done
52+
53+
54+
PICO="evb-pico"
55+
#Zephyr
56+
for board in $PICO; do
57+
for rtos in "baremetal"; do
58+
dotest $board "Pico-SDK" $rtos
59+
done
60+
done
61+
62+
63+
ESP="esp32"
64+
for board in $ESP; do
65+
dotest $board "ESP-IDF" "baremetal"
66+
done
67+
68+
69+
ARDUINO="teensy41"
70+
71+
rm -rf workspace pico-sdk
72+
cd -

test/xpresso/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ROOT ?= $(realpath $(CURDIR)/../..)
2+
PROJECTS ?= $(wildcard ../../examples/nxp/*-xpresso-*)
3+
TARGET ?= Debug
4+
DOCKER = docker run --rm -v $(ROOT):$(ROOT) -v $(CURDIR):/root -w $(CURDIR)
5+
IMAGE ?= scaprile/xpresso
6+
HEADLESS_BUILD = /usr/local/mcuxpressoide/ide/mcuxpressoide --launcher.suppressErrors -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild
7+
8+
all: $(PROJECTS)
9+
$(DOCKER) $(IMAGE) $(HEADLESS_BUILD) -data workspace -removeAll workspace
10+
11+
$(PROJECTS): FORCE
12+
(make -C $@ && make -C $@ clean) || ( \
13+
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 )
16+
FORCE:

0 commit comments

Comments
 (0)