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