From f67e843be63ff2481c0693ee43eb77cf25174cec Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Thu, 3 Jul 2025 16:49:37 -0300 Subject: [PATCH 1/2] fix tests --- test/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/Makefile b/test/Makefile index 9f5f1e44..25d49791 100644 --- a/test/Makefile +++ b/test/Makefile @@ -10,7 +10,6 @@ ROOT_DIR = $(realpath $(CWD)/..) ENV ?= -e Tmp=. -e WINEDEBUG=-all DOCKER_BIN ?= docker DOCKER ?= $(DOCKER_BIN) run --platform linux/amd64 --rm $(ENV) -v $(ROOT_DIR):$(ROOT_DIR) -w $(CWD) -VCFLAGS ?= /nologo /W3 /O2 /MD /I. IPV6 ?= 1 ASAN ?= -fsanitize=address,undefined,alignment -fno-sanitize-recover=all -fno-omit-frame-pointer -fno-common ASAN_OPTIONS ?= detect_leaks=1 @@ -186,14 +185,17 @@ riscv: DEFS += -DMG_ENABLE_POSIX_FS=0 -DMG_ENABLE_TCPIP=1 -DMG_ENABLE_TCPIP_DRIV riscv: mongoose.h $(SRCS) $(DOCKER) mdashnet/riscv riscv-none-elf-gcc -march=rv32imc -mabi=ilp32 $(SRCS) $(OPTS) $(WARN) $(INCS) $(DEFS) $(TFLAGS) -o unit_test +vc98: VCFLAGS = /nologo /W3 /O2 /MD /I. $(DEFS) $(TFLAGS) vc98: Makefile mongoose.h $(SRCS) $(DOCKER) mdashnet/vc98 wine cl $(SRCS) $(VCFLAGS) $(DEFS) $(TFLAGS) /Fe$@.exe $(DOCKER) mdashnet/vc98 wine $@.exe +vc17: VCFLAGS = /nologo /W3 /O2 /MD /I. $(DEFS) $(TFLAGS) vc17: Makefile mongoose.h $(SRCS) $(DOCKER) mdashnet/vc17 wine64 cl $(SRCS) $(VCFLAGS) $(DEFS) $(TFLAGS) /Fe$@.exe $(DOCKER) mdashnet/vc17 wine64 $@.exe +vc22: VCFLAGS = /nologo /W3 /O2 /MD /I. $(DEFS) $(TFLAGS) vc22: Makefile mongoose.h $(SRCS) $(DOCKER) mdashnet/vc22 wine64 cl $(SRCS) $(VCFLAGS) $(DEFS) $(TFLAGS) /Fe$@.exe $(DOCKER) mdashnet/vc22 wine64 $@.exe From cd86559685ea009046e9597fc652476dc2e682c0 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Thu, 10 Jul 2025 15:27:28 -0300 Subject: [PATCH 2/2] Move tests to bash scripts and Makefiles --- test/Makefile | 4 +--- test/cube/Makefile | 9 ++++++-- test/esp-idf/Makefile | 2 +- test/wizard/Makefile | 13 +++++++++--- test/wizard/test.sh | 48 +++++++++++++++++++++++++++++-------------- test/xpresso/Makefile | 10 ++++++--- 6 files changed, 59 insertions(+), 27 deletions(-) diff --git a/test/Makefile b/test/Makefile index 25d49791..9f5f1e44 100644 --- a/test/Makefile +++ b/test/Makefile @@ -10,6 +10,7 @@ ROOT_DIR = $(realpath $(CWD)/..) ENV ?= -e Tmp=. -e WINEDEBUG=-all DOCKER_BIN ?= docker DOCKER ?= $(DOCKER_BIN) run --platform linux/amd64 --rm $(ENV) -v $(ROOT_DIR):$(ROOT_DIR) -w $(CWD) +VCFLAGS ?= /nologo /W3 /O2 /MD /I. IPV6 ?= 1 ASAN ?= -fsanitize=address,undefined,alignment -fno-sanitize-recover=all -fno-omit-frame-pointer -fno-common ASAN_OPTIONS ?= detect_leaks=1 @@ -185,17 +186,14 @@ riscv: DEFS += -DMG_ENABLE_POSIX_FS=0 -DMG_ENABLE_TCPIP=1 -DMG_ENABLE_TCPIP_DRIV riscv: mongoose.h $(SRCS) $(DOCKER) mdashnet/riscv riscv-none-elf-gcc -march=rv32imc -mabi=ilp32 $(SRCS) $(OPTS) $(WARN) $(INCS) $(DEFS) $(TFLAGS) -o unit_test -vc98: VCFLAGS = /nologo /W3 /O2 /MD /I. $(DEFS) $(TFLAGS) vc98: Makefile mongoose.h $(SRCS) $(DOCKER) mdashnet/vc98 wine cl $(SRCS) $(VCFLAGS) $(DEFS) $(TFLAGS) /Fe$@.exe $(DOCKER) mdashnet/vc98 wine $@.exe -vc17: VCFLAGS = /nologo /W3 /O2 /MD /I. $(DEFS) $(TFLAGS) vc17: Makefile mongoose.h $(SRCS) $(DOCKER) mdashnet/vc17 wine64 cl $(SRCS) $(VCFLAGS) $(DEFS) $(TFLAGS) /Fe$@.exe $(DOCKER) mdashnet/vc17 wine64 $@.exe -vc22: VCFLAGS = /nologo /W3 /O2 /MD /I. $(DEFS) $(TFLAGS) vc22: Makefile mongoose.h $(SRCS) $(DOCKER) mdashnet/vc22 wine64 cl $(SRCS) $(VCFLAGS) $(DEFS) $(TFLAGS) /Fe$@.exe $(DOCKER) mdashnet/vc22 wine64 $@.exe diff --git a/test/cube/Makefile b/test/cube/Makefile index 459b4de0..cf70e643 100644 --- a/test/cube/Makefile +++ b/test/cube/Makefile @@ -7,18 +7,23 @@ IMAGE ?= scaprile/cubeozone all: $(PROJECTS) $(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -removeAll workspace + $(DOCKER) $(IMAGE) /bin/bash -c "rm -rf workspace/.metadata" $(PROJECTS): FORCE (make -C $@ && sudo make -C $@ clean) || ( \ COREDIRS=`find $@ -maxdepth 1 -name 'CM*' -print` && ( \ (test "$$COREDIRS" = "" && \ PROJNAME=`xq -r .projectDescription.name $@/.project` && \ - $(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -import $@ -cleanBuild $$PROJNAME/$(TARGET) ) || ( \ + $(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -import $@ -cleanBuild $$PROJNAME/$(TARGET) && \ + $(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -remove $@ && \ + $(DOCKER) $(IMAGE) /bin/bash -c "rm -rf $@/.settings $@/$(TARGET)") || ( \ (test "$$COREDIRS" != "" && \ for core in $$COREDIRS; do \ DIR=`basename $$core` \ PROJNAME=`xq -r .projectDescription.name $@/$$DIR/.project` && \ - $(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -import $@/$$DIR -cleanBuild $$PROJNAME/$(TARGET) || exit 1; \ + $(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -import $@/$$DIR -cleanBuild $$PROJNAME/$(TARGET) && \ + $(DOCKER) $(IMAGE) $(PATHTO)headless-build.sh -data workspace -remove $@/$$DIR && \ + $(DOCKER) $(IMAGE) /bin/bash -c "rm -rf $@/$$DIR/.settings $@/$$DIR/Drivers $@/$$DIR/Middlewares $@/$$DIR/$(TARGET)" || exit 1; \ done )))) FORCE: diff --git a/test/esp-idf/Makefile b/test/esp-idf/Makefile index e38d7256..5a0ecaf0 100644 --- a/test/esp-idf/Makefile +++ b/test/esp-idf/Makefile @@ -11,6 +11,6 @@ all: $(PROJECTS) $(PROJECTS): FORCE (make -C $@ build && make -C $@ clean) || ( \ $(DOCKER) $(IMAGE) /bin/bash -c 'cd $@ && idf.py build' && \ - rm -rf build sdkconfig ) + $(DOCKER) $(IMAGE) /bin/bash -c 'rm -rf .cache && cd $@ && rm -rf build sdkconfig') FORCE: diff --git a/test/wizard/Makefile b/test/wizard/Makefile index ffa5aaf3..a1665c7c 100644 --- a/test/wizard/Makefile +++ b/test/wizard/Makefile @@ -6,12 +6,15 @@ ifeq "$(IDE)" "GCC+make" BUILD = $(MAKE) -f ../gcc+make/Makefile PROJECTS=wizard endif ifeq "$(IDE)" "CubeIDE" -BUILD = $(MAKE) -f ../cube/Makefile PROJECTS=wizard && rm -rf workspace +BUILD = mkdir -p workspace && $(MAKE) -f ../cube/Makefile PROJECTS=wizard && rmdir workspace endif ifeq "$(IDE)" "MCUXpresso" -BUILD = $(MAKE) -f ../xpresso/Makefile PROJECTS=wizard && rm -rf workspace +BUILD = mkdir -p workspace && $(MAKE) -f ../xpresso/Makefile PROJECTS=wizard && rmdir workspace endif -ifeq "$(IDE)" "Keil" +ifeq "$(IDE)" "ModusIDE" +BUILD = true +endif +ifeq "$(IDE)" "e2studio" BUILD = true endif ifeq "$(IDE)" "Pico-SDK" @@ -20,6 +23,9 @@ endif ifeq "$(IDE)" "ESP-IDF" BUILD = $(MAKE) -f ../esp-idf/Makefile PROJECTS=wizard endif +ifeq "$(IDE)" "Keil" +BUILD = true +endif ifeq "$(IDE)" "Arduino" BUILD = true endif @@ -32,6 +38,7 @@ endif firmware.bin: wizard + (test "$(BUILD)" == "true" && echo "NOT TESTING $(BOARD) $(IDE) $(RTOS): don't know how to test $(IDE) projects" >> test.log) || true $(BUILD) && rm -rf wizard* wizard: FORCE diff --git a/test/wizard/test.sh b/test/wizard/test.sh index f7f763fe..ec4f07fb 100755 --- a/test/wizard/test.sh +++ b/test/wizard/test.sh @@ -29,7 +29,7 @@ done dotest h7s3l8 GCC+make baremetal -NXP="mcxn947" +NXP="rt1020 rt1024 rt1040 rt1060 rt1064 rt1170 mcxn947" NXPIDES="GCC+make MCUXpresso" for board in $NXP; do for ide in $NXPIDES; do @@ -38,16 +38,9 @@ for board in $NXP; do done done done -NXP="rt1020 rt1024 rt1040 rt1060 rt1064 rt1170" +NXP="rw612" for board in $NXP; do - dotest $board "GCC+make" "baremetal" -done - - -INFINEON="xmc4400 xmc4700 xmc7200" -INFINEONIDES="GCC+make" -for board in $INFINEON; do - for ide in $INFINEONIDES; do + for ide in $NXPIDES; do for rtos in "baremetal"; do dotest $board $ide $rtos done @@ -67,10 +60,13 @@ done dotest "tms570" "CGT+make" "baremetal" -PICO="evb-pico evb-pico2 evb-pico2-w5100 pico-w pico2-w" -for board in $PICO; do - for rtos in "baremetal"; do - dotest $board "Pico-SDK" $rtos +INFINEON="xmc4400 xmc4700 xmc7200" +INFINEONIDES="GCC+make ModusIDE" +for board in $INFINEON; do + for ide in $INFINEONIDES; do + for rtos in "baremetal"; do + dotest $board $ide $rtos + done done done @@ -80,10 +76,32 @@ for board in $ESP; do dotest $board "ESP-IDF" "baremetal" done + +PICO="evb-pico evb-pico2 evb-pico2-w5100 pico-w pico2-w" +for board in $PICO; do + for rtos in "baremetal"; do + dotest $board "Pico-SDK" $rtos + done +done + + +#NORDIC + +RENESAS="ra6 ra8m1" +RENESASIDES="GCC+make e2studio" +for board in $RENESAS; do + for ide in $RENESASIDES; do + for rtos in "baremetal"; do + dotest $board $ide $rtos + done + done +done + + # f439 not supported # h755 not supported in 3.7.0 branch; master branch currently not building # other ST boards (PHY address != 0) might build and not work -ZEPHYR="zephyr zephyr-w5500 f207 f429 f746 f756 f767 h563 h573 h723 h735 h743 h745 h747 h753 mcxn947 rt1060 rt1064 evb-pico" +ZEPHYR="zephyr zephyr-w5500 f207 f429 f746 f756 f767 h563 h573 h723 h735 h743 h745 h747 h753 mcxn947 rt1060 rt1064 evb-pico nrf91" for board in $ZEPHYR; do dotest $board "Zephyr" "baremetal" done diff --git a/test/xpresso/Makefile b/test/xpresso/Makefile index 8b9273bd..e7674e1f 100644 --- a/test/xpresso/Makefile +++ b/test/xpresso/Makefile @@ -1,17 +1,21 @@ +# NXP command line tool is useless for this task, using Eclipse headless build + ROOT ?= $(realpath $(CURDIR)/../..) PROJECTS ?= $(wildcard ../../tutorials/nxp/*-xpresso-*) TARGET ?= Debug -DOCKER = docker run --rm -v $(ROOT):$(ROOT) -v $(CURDIR):/root -w $(CURDIR) +DOCKER = docker run --rm --ulimit nofile=1024:524288 -v $(ROOT):$(ROOT) -v $(CURDIR):/root -w $(CURDIR) IMAGE ?= scaprile/xpresso HEADLESS_BUILD = /usr/local/mcuxpressoide/ide/mcuxpressoide --launcher.suppressErrors -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild all: $(PROJECTS) $(DOCKER) $(IMAGE) $(HEADLESS_BUILD) -data workspace -removeAll workspace + $(DOCKER) $(IMAGE) /bin/bash -c "rm -rf workspace/.metadata workspace/.mcuxpressoide* workspace/.gitignore mcuxpresso .cache .p2 .eclipse" $(PROJECTS): FORCE (make -C $@ && make -C $@ clean) || ( \ PROJNAME=`xq -r .projectDescription.name $@/.project` && \ - ($(DOCKER) $(IMAGE) $(HEADLESS_BUILD) -data workspace -import wizard -cleanBuild $$PROJNAME/$(TARGET) || true) && \ - test -f $(@F)/$(TARGET)/$$PROJNAME.axf ) + ($(DOCKER) $(IMAGE) $(HEADLESS_BUILD) -data workspace -import $@ -cleanBuild $$PROJNAME/$(TARGET) || true) && \ + test -f $(@F)/$(TARGET)/$$PROJNAME.axf && \ + $(DOCKER) $(IMAGE) /bin/bash -c "find $@/$(TARGET) -mindepth 1 ! -name '*.ld' -exec rm -rf {} +") FORCE: