aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--.gitmodules3
-rw-r--r--tests/Makefile22
m---------tests/Unity0
-rw-r--r--tests/browser-net.tests.c5
5 files changed, 33 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index fac7782..99d051c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
browser
server
*.txt
+
+tests/*.tests
+tests/*.tests_Runner.c
diff --git a/.gitmodules b/.gitmodules
index 071acbc..3120806 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
[submodule "src/sds"]
path = src/sds
url = https://github.com/antirez/sds.git
+[submodule "tests/Unity"]
+ path = tests/Unity
+ url = https://github.com/ThrowTheSwitch/Unity.git
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
diff --git a/tests/Unity b/tests/Unity
new file mode 160000
+Subproject b4f65573f75564d4b5d33e1812a31946191620d
diff --git a/tests/browser-net.tests.c b/tests/browser-net.tests.c
new file mode 100644
index 0000000..2a8fec0
--- /dev/null
+++ b/tests/browser-net.tests.c
@@ -0,0 +1,5 @@
+#include "Unity/src/unity.h"
+
+void test_True(void) {
+ TEST_ASSERT_TRUE(1);
+}