diff --git a/.circleci/config.yml b/.circleci/config.yml index 67f7497..9376d20 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,6 +12,9 @@ jobs: - run: name: "Enforce Go Formatted Code" command: make fmt-check + - run: + name: "Run unit tests" + command: make unit-test - run: name: "Run build and smoke tests" command: make smoke-test diff --git a/Makefile b/Makefile index 19047d4..1b36feb 100644 --- a/Makefile +++ b/Makefile @@ -160,4 +160,13 @@ endif tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/lis2mdl/main.go @md5sum ./build/test.hex -test: clean fmt-check smoke-test +DRIVERS = $(wildcard */) +NOTESTS = build examples flash semihosting pcd8544 shiftregister st7789 microphone mcp3008 gps microbitmatrix \ + hcsr04 ssd1331 ws2812 thermistor apa102 easystepper ssd1351 ili9341 wifinina shifter hub75 \ + hd44780 buzzer ssd1306 espat l9110x st7735 bmi160 l293x +TESTS = $(filter-out $(addsuffix /%,$(NOTESTS)),$(DRIVERS)) + +unit-test: + @go test -v $(addprefix ./,$(TESTS)) + +test: clean fmt-check unit-test smoke-test