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