Skip to content

Commit e612f7c

Browse files
aykevldeadprogram
authored andcommitted
Add smoke tests for machine package
The machine package wasn't tested for every board. Therefore, add a new serial-like test that also tries to import the machine package. This should highlight potential issues in the future.
1 parent 385a792 commit e612f7c

File tree

2 files changed

+30
-13
lines changed

2 files changed

+30
-13
lines changed

GNUmakefile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ smoketest:
491491
@$(MD5SUM) test.hex
492492
$(TINYGO) build -size short -o test.hex -target=nano-rp2040 examples/rtcinterrupt
493493
@$(MD5SUM) test.hex
494-
$(TINYGO) build -size short -o test.hex -target=pca10040 examples/serial
494+
$(TINYGO) build -size short -o test.hex -target=pca10040 examples/machinetest
495495
@$(MD5SUM) test.hex
496496
$(TINYGO) build -size short -o test.hex -target=pca10040 examples/systick
497497
@$(MD5SUM) test.hex
@@ -523,7 +523,7 @@ ifneq ($(WASM), 0)
523523
@$(MD5SUM) test.wasm
524524
$(TINYGO) build -size short -o test.wasm -tags=circuitplay_bluefruit examples/blinky1
525525
@$(MD5SUM) test.wasm
526-
$(TINYGO) build -size short -o test.wasm -tags=mch2022 examples/serial
526+
$(TINYGO) build -size short -o test.wasm -tags=mch2022 examples/machinetest
527527
@$(MD5SUM) test.wasm
528528
$(TINYGO) build -size short -o test.wasm -tags=gopher_badge examples/blinky1
529529
@$(MD5SUM) test.wasm
@@ -621,7 +621,7 @@ endif
621621
@$(MD5SUM) test.hex
622622
$(TINYGO) build -size short -o test.hex -target=itsybitsy-nrf52840 examples/blinky1
623623
@$(MD5SUM) test.hex
624-
$(TINYGO) build -size short -o test.hex -target=qtpy examples/serial
624+
$(TINYGO) build -size short -o test.hex -target=qtpy examples/machinetest
625625
@$(MD5SUM) test.hex
626626
$(TINYGO) build -size short -o test.hex -target=teensy41 examples/blinky1
627627
@$(MD5SUM) test.hex
@@ -693,7 +693,7 @@ endif
693693
@$(MD5SUM) test.hex
694694
$(TINYGO) build -size short -o test.hex -target=feather-nrf52840 examples/usb-midi
695695
@$(MD5SUM) test.hex
696-
$(TINYGO) build -size short -o test.hex -target=nrf52840-s140v6-uf2-generic examples/serial
696+
$(TINYGO) build -size short -o test.hex -target=nrf52840-s140v6-uf2-generic examples/machinetest
697697
@$(MD5SUM) test.hex
698698
ifneq ($(STM32), 0)
699699
$(TINYGO) build -size short -o test.hex -target=bluepill examples/blinky1
@@ -735,7 +735,7 @@ ifneq ($(STM32), 0)
735735
endif
736736
$(TINYGO) build -size short -o test.hex -target=atmega328pb examples/blinkm
737737
@$(MD5SUM) test.hex
738-
$(TINYGO) build -size short -o test.hex -target=atmega1284p examples/serial
738+
$(TINYGO) build -size short -o test.hex -target=atmega1284p examples/machinetest
739739
@$(MD5SUM) test.hex
740740
$(TINYGO) build -size short -o test.hex -target=arduino examples/blinky1
741741
@$(MD5SUM) test.hex
@@ -762,22 +762,22 @@ ifneq ($(XTENSA), 0)
762762
@$(MD5SUM) test.bin
763763
$(TINYGO) build -size short -o test.bin -target=nodemcu examples/blinky1
764764
@$(MD5SUM) test.bin
765-
$(TINYGO) build -size short -o test.bin -target m5stack-core2 examples/serial
765+
$(TINYGO) build -size short -o test.bin -target m5stack-core2 examples/machinetest
766766
@$(MD5SUM) test.bin
767-
$(TINYGO) build -size short -o test.bin -target m5stack examples/serial
767+
$(TINYGO) build -size short -o test.bin -target m5stack examples/machinetest
768768
@$(MD5SUM) test.bin
769-
$(TINYGO) build -size short -o test.bin -target m5stick-c examples/serial
769+
$(TINYGO) build -size short -o test.bin -target m5stick-c examples/machinetest
770770
@$(MD5SUM) test.bin
771-
$(TINYGO) build -size short -o test.bin -target m5paper examples/serial
771+
$(TINYGO) build -size short -o test.bin -target m5paper examples/machinetest
772772
@$(MD5SUM) test.bin
773-
$(TINYGO) build -size short -o test.bin -target mch2022 examples/serial
773+
$(TINYGO) build -size short -o test.bin -target mch2022 examples/machinetest
774774
@$(MD5SUM) test.bin
775775
endif
776-
$(TINYGO) build -size short -o test.bin -target=qtpy-esp32c3 examples/serial
776+
$(TINYGO) build -size short -o test.bin -target=qtpy-esp32c3 examples/machinetest
777777
@$(MD5SUM) test.bin
778-
$(TINYGO) build -size short -o test.bin -target=m5stamp-c3 examples/serial
778+
$(TINYGO) build -size short -o test.bin -target=m5stamp-c3 examples/machinetest
779779
@$(MD5SUM) test.bin
780-
$(TINYGO) build -size short -o test.bin -target=xiao-esp32c3 examples/serial
780+
$(TINYGO) build -size short -o test.bin -target=xiao-esp32c3 examples/machinetest
781781
@$(MD5SUM) test.bin
782782
$(TINYGO) build -size short -o test.hex -target=hifive1b examples/blinky1
783783
@$(MD5SUM) test.hex
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package main
2+
3+
// This is the same as examples/serial, but it also imports the machine package.
4+
// It is used as a smoke test for the machine package (for boards that don't
5+
// have an on-board LED and therefore can't use examples/blinky1).
6+
7+
import (
8+
_ "machine" // smoke test for the machine package
9+
"time"
10+
)
11+
12+
func main() {
13+
for {
14+
println("hello world!")
15+
time.Sleep(time.Second)
16+
}
17+
}

0 commit comments

Comments
 (0)