File: Makefile

package info (click to toggle)
apache2 2.4.66-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 59,324 kB
  • sloc: ansic: 212,315; python: 13,830; perl: 11,307; sh: 7,254; php: 1,320; javascript: 1,314; awk: 749; makefile: 715; lex: 374; yacc: 161; xml: 2
file content (67 lines) | stat: -rw-r--r-- 1,279 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# mod_macro non regression tests

# where is apache
APA.dir	= /tmp/apache

# apache executable with mod macro loaded
HTTPD = \
	$(APA.dir)/bin/httpd \
	  -C 'LoadModule macro_module modules/mod_macro.so' \
	  -C "Define PWD $$PWD/conf"

# default target
.PHONY: default
default: clean

# run all non regression tests
.PHONY: check
check: check-out

# result directory
OUT	= out
out:
	mkdir $@

# test cases & results
F.conf	= $(wildcard conf/test*.conf)
F.out	= $(F.conf:conf/%.conf=$(OUT)/%.out)

# run all tests
.PHONY: run-test
run-test: $(F.out)

# generate & compare in a separate directory
.PHONY: check-out
check-out: out
	$(RM) out/*.out
	$(MAKE) OUT=out run-test
	diff -r out/ ref/

# generate & compare in the same directory
.PHONY: check-ref
check-ref:
	$(RM) ref/*.out
	$(MAKE) OUT=ref run-test
	svn diff ref/

# run one test case
# filter output so that it is portable
# use '|' sed separator because $PWD will contain plenty '/'
$(OUT)/%.out: conf/%.conf
	{ \
	  echo "# testing with $<" ; \
	  $(HTTPD) -f $$PWD/$< 2>&1 ; \
	  echo "# exit: $$?" ; \
	} > $@.tmp ; \
	sed -e "s|$$PWD|.|g" \
	    -e "s|^\[[\.a-zA-Z0-9 :]*\] ||" \
	    -e "s|\[pid [0-9]*:tid [0-9]*] ||" \
	    $@.tmp > $@ ; \
	$(RM) $@.tmp

# cleanup
.PHONY: clean
clean:
	$(RM) *~
	$(RM) -r out