Makefile revision f545d156561c08020a67f9640c51454c2df4fb57
2N/A#
2N/A# $Id$
2N/A#
2N/A# mod_macro non regression tests
2N/A
2N/A# where is apache
2N/AAPA.dir = /tmp/apache
2N/A
2N/A# apache executable with mod macro loaded
2N/AHTTPD = \
2N/A $(APA.dir)/bin/httpd \
2N/A -C 'LoadModule macro_module modules/mod_macro.so' \
2N/A -C "Define PWD $$PWD/conf"
2N/A
2N/A# default target
2N/A.PHONY: default
2N/Adefault: clean
2N/A
2N/A# run all non regression tests
2N/A.PHONY: check
2N/Acheck: check-out
2N/A
2N/A# result directory
2N/AOUT = out
2N/Aout:
2N/A mkdir $@
2N/A
2N/A# test cases & results
2N/AF.conf = $(wildcard conf/test*.conf)
2N/AF.out = $(F.conf:conf/%.conf=$(OUT)/%.out)
2N/A
2N/A# run all tests
2N/A.PHONY: run-test
2N/Arun-test: $(F.out)
2N/A
2N/A# generate & compare in a separate directory
2N/A.PHONY: check-out
2N/Acheck-out: out
2N/A $(RM) out/*.out
2N/A $(MAKE) OUT=out run-test
2N/A diff -r out/ ref/
2N/A
2N/A# generate & compare in the same directory
2N/A.PHONY: check-ref
2N/Acheck-ref:
2N/A $(RM) ref/*.out
2N/A $(MAKE) OUT=ref run-test
2N/A svn diff ref/
2N/A
2N/A# run one test case
2N/A# filter output so that it is portable
2N/A# use '|' sed separator because $PWD will contain plenty '/'
2N/A$(OUT)/%.out: conf/%.conf
2N/A { \
2N/A echo "# testing with $<" ; \
2N/A $(HTTPD) -f $$PWD/$< 2>&1 ; \
2N/A echo "# exit: $$?" ; \
2N/A } > $@.tmp ; \
2N/A sed -e "s|$$PWD|.|g" \
2N/A -e "s|^\[[\.a-zA-Z0-9 :]*\] ||" \
2N/A -e "s|\[pid [0-9]*:tid [0-9]*] ||" \
2N/A $@.tmp > $@ ; \
2N/A $(RM) $@.tmp
2N/A
2N/A# cleanup
2N/A.PHONY: clean
2N/Aclean:
2N/A $(RM) *~
2N/A $(RM) -r out
2N/A