aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2012-11-29 03:50:52 +0100
committerLaurent Ghigonis <laurent@p1sec.com>2012-11-29 03:50:52 +0100
commit2b8190f943d356ef5510eda7aab7d79cf3dd75cd (patch)
tree5a70fed787a70d6b9317d67c600319bae798837c
parentadd first unit tests (diff)
downloadglouglou-2b8190f943d356ef5510eda7aab7d79cf3dd75cd.tar.xz
glouglou-2b8190f943d356ef5510eda7aab7d79cf3dd75cd.zip
add a way to run all the tests and document it in tests/README.txt
-rw-r--r--libglouglou/tests/Makefile13
-rw-r--r--libglouglou/tests/README.txt4
2 files changed, 17 insertions, 0 deletions
diff --git a/libglouglou/tests/Makefile b/libglouglou/tests/Makefile
index bce183d..13f9de4 100644
--- a/libglouglou/tests/Makefile
+++ b/libglouglou/tests/Makefile
@@ -10,5 +10,18 @@ all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(TARGET) $(OBJECTS)
+run:
+ @errors=0 ;\
+ for test in $(TARGET); do \
+ echo -n "$$test " ;\
+ LD_LIBRARY_PATH=../ ./$$test ;\
+ if [ $$? -eq 0 ]; then \
+ echo OK ;\
+ else \
+ echo FAILED ;\
+ fi ;\
+ done ;\
+ exit $$errors
+
clean:
rm -f $(TARGET) $(OBJECTS)
diff --git a/libglouglou/tests/README.txt b/libglouglou/tests/README.txt
new file mode 100644
index 0000000..fb19ae8
--- /dev/null
+++ b/libglouglou/tests/README.txt
@@ -0,0 +1,4 @@
+libglouglou unit tests
+
+do "make run" to execute them
+returns the number of tests that failed