From 2b8190f943d356ef5510eda7aab7d79cf3dd75cd Mon Sep 17 00:00:00 2001 From: Laurent Ghigonis Date: Thu, 29 Nov 2012 03:50:52 +0100 Subject: add a way to run all the tests and document it in tests/README.txt --- libglouglou/tests/Makefile | 13 +++++++++++++ libglouglou/tests/README.txt | 4 ++++ 2 files changed, 17 insertions(+) create mode 100644 libglouglou/tests/README.txt (limited to 'libglouglou') 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 -- cgit v1.2.3-59-g8ed1b