Update Changelog
[profile/ivi/libgee.git] / Makefile.decl
1 # GLIB - Library of useful C routines
2
3 GTESTER = gtester 
4 GTESTER_REPORT = gtester-report
5
6 # initialize variables for unconditional += appending
7 EXTRA_DIST =
8 TEST_PROGS =
9
10 # useful constants
11 NULL = 
12
13 ### testing rules
14
15 # test: run all tests in cwd and subdirs
16 test:   ${TEST_PROGS}
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 $? ; \
21           done
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}" || { \
27           case $@ in \
28           test-report) test_options="-k";; \
29           perf-report) test_options="-k -m=perf";; \
30           full-report) test_options="-k -m=perf -m=slow";; \
31           esac ; \
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} ; \
36           fi ; \
37         }
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 ; \
42           fi ; \
43           for subdir in $(SUBDIRS) . ; do \
44             test "$$subdir" = "." -o "$$subdir" = "po" || \
45             ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
46           done ; \
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 ; \
52             done ; \
53             echo >> $@.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 ; \
57           }
58 .PHONY: test test-report perf-report full-report
59 # run make test as part of make check
60 check-local: test