From f2265acf6944139be0095d42ac9a98d297390077 Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Sun, 3 Feb 2013 17:04:39 +0100 Subject: [PATCH] build: merged gtester makefile with latest glib --- build/Makefile.am.gtester | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/build/Makefile.am.gtester b/build/Makefile.am.gtester index de89ddfa..3c92b9a6 100644 --- a/build/Makefile.am.gtester +++ b/build/Makefile.am.gtester @@ -1,10 +1,22 @@ TEST_PROGS= -test: check -check-local: $(TEST_PROGS) - @test -z "${TEST_PROGS}" || ${GTESTER} --verbose $(TEST_PROGS) +### testing rules +# test: run all tests in cwd and subdirs +test: test-nonrecursive + @ for subdir in $(SUBDIRS) . ; do \ + test "$$subdir" = "." -o "$$subdir" = "po" || \ + ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ + done + +# test-nonrecursive: run tests only in cwd +test-nonrecursive: ${TEST_PROGS} + @test -z "${TEST_PROGS}" || G_DEBUG=gc-friendly MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS} + +# test-report: run tests in subdirs and generate report +# perf-report: run tests in subdirs with -m perf and generate report +# full-report: like test-report: with -m perf and -m slow test-report perf-report full-report: ${TEST_PROGS} @test -z "${TEST_PROGS}" || { \ case $@ in \ @@ -13,7 +25,7 @@ test-report perf-report full-report: ${TEST_PROGS} full-report) test_options="-k -m=perf -m=slow";; \ esac ; \ if test -z "$$GTESTER_LOGDIR" ; then \ - ${GTESTER} --verbose $$test_options -o $@.xml ${TEST_PROGS} ; \ + ${GTESTER} --verbose $$test_options -o test-report.xml ${TEST_PROGS} ; \ elif test -n "${TEST_PROGS}" ; then \ ${GTESTER} --verbose $$test_options -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ${TEST_PROGS} ; \ fi ; \ @@ -23,23 +35,32 @@ test-report perf-report full-report: ${TEST_PROGS} GTESTER_LOGDIR=`mktemp -d "\`pwd\`/.testlogs-XXXXXX"`; export GTESTER_LOGDIR ; \ ignore_logdir=false ; \ fi ; \ + if test -d "$(top_srcdir)/.git" ; then \ + REVISION=`git describe` ; \ + else \ + REVISION=$(VERSION) ; \ + fi ; \ for subdir in $(SUBDIRS) . ; do \ test "$$subdir" = "." -o "$$subdir" = "po" -o "$$subdir" = "po-properties" || \ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \ done ; \ $$ignore_logdir || { \ - echo '' > $@.xml ; \ - echo '' >> $@.xml ; \ - echo '' >> $@.xml ; \ - echo ' @PACKAGE_NAME@' >> $@.xml ; \ - echo ' @VERSION@' >> $@.xml ; \ - echo '' >> $@.xml ; \ + echo '' > $@.xml ; \ + echo '' >> $@.xml ; \ + echo '' >> $@.xml ; \ + echo ' $(PACKAGE)' >> $@.xml ; \ + echo ' $(VERSION)' >> $@.xml ; \ + echo " $$REVISION" >> $@.xml ; \ + echo '' >> $@.xml ; \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ - ${SED} '1,1s/^]*>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ + ${SED} '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ done ; \ + echo >> $@.xml ; \ echo '' >> $@.xml ; \ rm -rf "$$GTESTER_LOGDIR"/ ; \ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \ } +.PHONY: test test-report perf-report full-report test-nonrecursive -.PHONY: test test-report perf-report full-report +# run tests in cwd as part of make check +check-local: test-nonrecursive -- 2.11.4.GIT