diff Makefile @ 36:f9501248b6bd

Add tests
author Guido Berhoerster <guido+pwm@berhoerster.name>
date Wed, 07 Aug 2019 11:28:07 +0200
parents 34ada71ff3e5
children
line wrap: on
line diff
--- a/Makefile	Tue Aug 06 11:21:04 2019 +0200
+++ b/Makefile	Wed Aug 07 11:28:07 2019 +0200
@@ -51,6 +51,8 @@
 DOCBOOK5_MANPAGES_FLAGS =	--stringparam man.authors.section.enabled 0 \
 				--stringparam man.copyright.section.enabled 0
 
+TESTS_OUTPUT_PATH = ./tests/output
+
 define generate-manpage-rule =
 $(addsuffix .%,$(basename $1)): $(addsuffix .%.xml,$(basename $(firstword $1))) docbook-update-source-data.xsl
 	$$(XSLTPROC) \
@@ -179,7 +181,7 @@
 
 .DEFAULT_TARGET = all
 
-.PHONY: all clean clobber dist install
+.PHONY: all check clean clobber dist install
 
 all: $(PWM_BIN) $(PWM_CLIP_BIN) $(MANPAGES)
 
@@ -275,6 +277,11 @@
 	    fi \
 	done
 
+check: $(PWM_BIN)
+	rm -rf $(TESTS_OUTPUT_PATH); \
+	SHELL=$(SHELL) PWM=./$(PWM_BIN) \
+	    TESTS_OUTPUT_PATH=$(TESTS_OUTPUT_PATH) $(SHELL) tests/run-tests.sh
+
 clean:
 	rm -f $(LIBCOMPAT_LIB) $(LIBPWM_LIB) $(PWM_CLIP_BIN) $(PWM_BIN) \
 	    $(OBJS) $(MANPAGES)