diff Makefile @ 4:dfd3ddbdb201

Add tests
author Guido Berhoerster <guido+libpws@berhoerster.name>
date Fri, 13 May 2016 14:32:44 +0200
parents 97097b4b6bfb
children 0feba0fea9d0
line wrap: on
line diff
--- a/Makefile	Fri Apr 03 14:57:57 2015 +0200
+++ b/Makefile	Fri May 13 14:32:44 2016 +0200
@@ -66,6 +66,8 @@
 				--stringparam css.decoration 0 \
 				--stringparam default.table.width '100%'
 
+TESTS_OUTPUT_PATH = ./tests/output
+
 define generate-manpage-rule =
 $(addsuffix .%,$(basename $1)): $(addsuffix .%.xml,$(basename $(firstword $1))) docbook-update-source-data.xsl
 	$$(XSLTPROC) \
@@ -248,7 +250,7 @@
 
 .DEFAULT_TARGET = all
 
-.PHONY: all clean clobber dist install
+.PHONY: all clean clobber dist install check
 
 all: $(PWSDUMP_BIN) $(LIBPWS_LIB) $(MANPAGES)
 
@@ -362,9 +364,15 @@
 	    fi \
 	done
 
+check: $(PWSDUMP_BIN)
+	rm -rf $(TESTS_OUTPUT_PATH); \
+	SHELL=$(SHELL) PWSDUMP=$(PWSDUMP_BIN) \
+	    TESTS_OUTPUT_PATH=$(TESTS_OUTPUT_PATH) $(SHELL) tests/run-tests.sh
+
 clean:
 	rm -f $(LIBPWS_LIB) $(PWSDUMP_BIN) $(OBJS) $(MANPAGES) \
 	    $(XHTML_DOCUMENTATION)
+	rm -rf $(TESTS_OUTPUT_PATH)
 
 clobber: clean
 	rm -f $(patsubst %.o,%.d,$(OBJS))