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