aboutsummaryrefslogtreecommitdiff
path: root/tests/Makefile
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2024-01-07 10:05:26 +0200
committerSyndamia <kamen@syndamia.com>2024-01-07 10:05:26 +0200
commitf5adcdd552f743d372a62a4c30184c4c8cd98cfd (patch)
treed5978223568462a165b1fc3e9cbd66dad3ff8b80 /tests/Makefile
parentde36da78460442c8a7e1079d4c23cc02a77d11a3 (diff)
downloadpico-web-f5adcdd552f743d372a62a4c30184c4c8cd98cfd.tar
pico-web-f5adcdd552f743d372a62a4c30184c4c8cd98cfd.tar.gz
pico-web-f5adcdd552f743d372a62a4c30184c4c8cd98cfd.zip
(tests) Started work on unit tests
Diffstat (limited to 'tests/Makefile')
-rw-r--r--tests/Makefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/Makefile b/tests/Makefile
new file mode 100644
index 0000000..4c6f82b
--- /dev/null
+++ b/tests/Makefile
@@ -0,0 +1,22 @@
+RUBY=ruby
+UNITY_DIR=./Unity
+CC=gcc
+CFLAGS=-I$(UNITY_DIR)/src
+
+.PHONY: all
+all: build run
+
+.PHONY: build
+build:
+ for testfile in $$(find . -type f -name "*.tests.c") ;\
+ do \
+ $(RUBY) $(UNITY_DIR)/auto/generate_test_runner.rb $$testfile ;\
+ $(CC) $(CFLAGS) -o $${testfile%.c} $(UNITY_DIR)/src/unity.c $$testfile $${testfile%.c}_Runner.c ;\
+ done
+
+.PHONY: run
+run:
+ for runner in $$(find . -type f -name "*.tests") ;\
+ do \
+ $$runner || exit ;\
+ done