2 GTESTER_REPORT
= gtester-report
4 # initialize variables for unconditional += appending
9 # test: run all tests in cwd and subdirs
10 test: test-cwd test-recurse
11 # test-cwd: run tests in cwd
12 test-cwd
: ${TEST_PROGS}
13 @
[ -z
"$(TEST_PROGS)" ] ||
{ set
-e
; $(TESTS_ENVIRONMENT
) ${GTESTER} --verbose
${TEST_PROGS}; }
15 # test-recurse: run tests in subdirs
17 @ for subdir in
$(SUBDIRS
) ; do \
18 test "$$subdir" = "." \
19 -o
"$$subdir" = "config" \
20 -o
"$$subdir" = "doc" \
21 -o
"$$subdir" = "manual" \
22 -o
"$$subdir" = "m4" \
23 -o
"$$subdir" = "po" \
24 -o
"$$subdir" = "tools" \
26 ( cd
$$subdir && $(MAKE
) $(AM_MAKEFLAGS
) test ) || exit
$?
; \
28 # test-report: run tests in subdirs and generate report
29 # perf-report: run tests in subdirs with -m perf and generate report
30 # full-report: like test-report: with -m perf and -m slow
31 test-report perf-report full-report
: ${TEST_PROGS}
32 @ ignore_logdir
=true
; \
33 if
test -z
"$$GTESTER_LOGDIR" ; then \
34 GTESTER_LOGDIR
=`mktemp -d "\`pwd\
`/.testlogs-XXXXXX"`; export GTESTER_LOGDIR
; \
35 ignore_logdir
=false
; \
37 for subdir in
$(SUBDIRS
) ; do \
38 test "$$subdir" = "." -o
"$$subdir" = "po" -o
"$$subdir" = "po-properties" || \
39 ( cd
$$subdir && $(MAKE
) $(AM_MAKEFLAGS
) $@
) || exit
$?
; \
41 test -z
"${TEST_PROGS}" ||
{ \
43 test-report
) test_options
="-k";; \
44 perf-report
) test_options
="-k -m=perf";; \
45 full-report
) test_options
="-k -m=perf -m=slow";; \
48 if
test -z
"$$GTESTER_LOGDIR" ; then \
49 ${GTESTER} --verbose
$$test_options -o test-report.xml
${TEST_PROGS} ; \
50 elif
test -n
"${TEST_PROGS}" ; then \
51 ${GTESTER} --verbose
$$test_options -o
`mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ${TEST_PROGS} ; \
54 $$ignore_logdir ||
{ \
55 echo
'<?xml version="1.0"?>' > $@.xml
; \
56 echo
'<report-collection>' >> $@.xml
; \
57 for lf in
`ls -L "$$GTESTER_LOGDIR"/.` ; do \
58 sed
'1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml
; \
61 echo
'</report-collection>' >> $@.xml
; \
62 rm -rf
"$$GTESTER_LOGDIR"/ ; \
63 ${GTESTER_REPORT} --version
2>/dev
/null
1>&2 ; test "$$?" != 0 ||
${GTESTER_REPORT} $@.xml
>$@.html
; \
65 .PHONY
: test test-cwd test-recurse test-report perf-report full-report
66 # run make test-cwd as part of make check