1 ## Adapted Makefile.decl found in glib-2.23.2
6 # test: run all tests in cwd and subdirs
9 @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS}
10 @ for subdir in $(SUBDIRS) . ; do \
11 test "$$subdir" = "." -o \
12 "$$subdir" = "po" -o \
13 "$$subdir" = "po-properties" || \
14 ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
18 # test-report: run tests in subdirs and generate report
19 # perf-report: run tests in subdirs with -m perf and generate report
20 # full-report: like test-report: with -m perf and -m slow
21 test-report perf-report full-report: ${TEST_PROGS}
22 @test -z "${TEST_PROGS}" || { \
24 test-report) test_options="-k";; \
25 perf-report) test_options="-k -m=perf";; \
26 full-report) test_options="-k -m=perf -m=slow";; \
28 if test -z "$$GTESTER_LOGDIR" ; then \
29 ${GTESTER} --verbose $$test_options -o test-report.xml ${TEST_PROGS} ; \
30 elif test -n "${TEST_PROGS}" ; then \
31 ${GTESTER} --verbose $$test_options -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ${TEST_PROGS} ; \
34 @ ignore_logdir=true ; \
35 if test -z "$$GTESTER_LOGDIR" ; then \
36 GTESTER_LOGDIR=`mktemp -d "\`pwd\`/.testlogs-XXXXXX"`; export GTESTER_LOGDIR ; \
37 ignore_logdir=false ; \
39 for subdir in $(SUBDIRS) . ; do \
40 test "$$subdir" = "." -o "$$subdir" = "po" || \
41 ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
43 $$ignore_logdir || { \
44 echo '<?xml version="1.0"?>' > $@.xml ; \
45 echo '<report-collection>' >> $@.xml ; \
46 for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
47 sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
50 echo '</report-collection>' >> $@.xml ; \
51 rm -rf "$$GTESTER_LOGDIR"/ ; \
52 ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \
55 .PHONY: test test-report perf-report full-report