build gchecksum.obj
[platform/upstream/glib.git] / Makefile.decl
1 # GLIB - Library of useful C routines
2
3 #GTESTER = gtester                      # for non-GLIB packages
4 GTESTER = $(top_builddir)/glib/gtester  # for the GLIB package
5
6 # initialize variables for unconditional += appending
7 EXTRA_DIST =
8 TEST_PROGS =
9
10 ### testing rules
11
12 # test: run all tests in cwd and subdirs
13 test:   ${TEST_PROGS}
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 $? ; \
18           done
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}" || { \
24           case $@ in \
25           test-report) test_options="-k";; \
26           perf-report) test_options="-k -m=perf";; \
27           full-report) test_options="-k -m=perf -m=slow";; \
28           esac ; \
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} ; \
33           fi ; \
34         }
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 ; \
39           fi ; \
40           for subdir in $(SUBDIRS) ; do \
41             test "$$subdir" = "." -o "$$subdir" = "po" || \
42             ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
43           done ; \
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 ; \
49             done ; \
50             echo >> $@.xml ; \
51             echo '</report-collection>' >> $@.xml ; \
52             rm -rf "$$GTESTER_LOGDIR"/ ; \
53           }
54 .PHONY: test test-report perf-report full-report
55 # run make test as part of make check
56 check-local: test