summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-10-31 14:10:30 (GMT)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-11-07 18:22:58 (GMT)
commit5582f77b867ddd0b8f6abd87ee01eb19bdc2002a (patch)
tree65d2016b677bbb21d356e6a9ec9989b693424099
parentece251a40c37483e20a4875f83e869c3309496cb (diff)
downloadtelepathy-logger-5582f77b867ddd0b8f6abd87ee01eb19bdc2002a.tar.gz
Use the Automake "parallel-tests" driver, albeit in non-parallel mode
This seems perverse, but it means we invoke tests in the same way I want to use for other Telepathy projects, which will help when we want to merge their source trees together. Now that we can rely on having the parallel-tests setup, we can use AM_TESTS_ENVIRONMENT instead of TESTS_ENVIRONMENT (which is now reserved for the user, like CFLAGS), and we must use LOG_COMPILER rather than TESTS_ENVIRONMENT for "adverb" command prefixes. We no longer need to use test-wrapper.sh for the tests, because Automake has similar functionality built-in. On a buildbot or similar, use "make check VERBOSE=1" to cat the logs automatically. (cherry picked from commit 09ff23c267f2b90576cb79c8d3187eda6cb435c8) Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71100
-rw-r--r--configure.ac2
-rw-r--r--tests/Makefile.am10
-rw-r--r--tests/dbus/Makefile.am23
3 files changed, 21 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index 60c8031..f593ab7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,7 +85,7 @@ AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_AUX_DIR([build-aux])
-AM_INIT_AUTOMAKE(1.12 dist-bzip2 no-define no-dist-gzip tar-ustar -Wno-portability serial-tests)
+AM_INIT_AUTOMAKE(1.12 dist-bzip2 no-define no-dist-gzip tar-ustar -Wno-portability parallel-tests)
AC_SEARCH_LIBS([strerror],[cposix])
AC_PROG_CC
AC_HEADER_STDC
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 436758b..83665d6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,3 +1,7 @@
+# These tests aren't ready for parallel invocation yet: they all use
+# the same log directory.
+.NOTPARALLEL:
+
SUBDIRS = $(CHECKTWISTED) suppressions lib dbus
EXTRA_DIST = logs
@@ -19,19 +23,17 @@ AM_CFLAGS = \
-I$(top_builddir) \
$(NULL)
-TESTS_ENVIRONMENT = \
+AM_TESTS_ENVIRONMENT = \
G_DEBUG=fatal-warnings,fatal-criticals \
TPL_TEST_MODE=true \
TEST_LOG_DIR=@abs_top_srcdir@/tests/logs \
- $(top_srcdir)/tools/test-wrapper.sh \
$(NULL)
check-valgrind: $(TESTS)
G_SLICE=always-malloc \
G_DEBUG=gc-friendly \
$(MAKE) \
- TESTS_ENVIRONMENT="$(TESTS_ENVIRONMENT) \
- libtool --mode=execute valgrind \
+ LOG_COMPILER="libtool --mode=execute valgrind \
--leak-check=full \
--show-reachable=no \
--gen-suppressions=all \
diff --git a/tests/dbus/Makefile.am b/tests/dbus/Makefile.am
index e0a8805..dcce50a 100644
--- a/tests/dbus/Makefile.am
+++ b/tests/dbus/Makefile.am
@@ -1,3 +1,7 @@
+# These tests aren't ready for parallel invocation yet: they all use
+# the same log directory.
+.NOTPARALLEL:
+
noinst_PROGRAMS = \
test-entity \
test-log-manager \
@@ -35,7 +39,7 @@ AM_CFLAGS = \
-I$(top_srcdir)/tests
$(NULL)
-TESTS_ENVIRONMENT = \
+AM_TESTS_ENVIRONMENT = \
abs_top_builddir=@abs_top_builddir@ \
TPL_TEST_MODE=true \
TPL_TEST_LOG_DIR=@abs_top_srcdir@/tests/logs \
@@ -45,25 +49,26 @@ TESTS_ENVIRONMENT = \
G_SLICE=debug-blocks \
TPL_DEBUG=all \
G_DEBUG=fatal_warnings,fatal_criticals$(maybe_gc_friendly) \
- $(top_srcdir)/tools/test-wrapper.sh \
+ $(NULL)
+
+LOG_COMPILER = \
sh $(top_srcdir)/tools/with-session-bus.sh \
--config-file=dbus-1/session.conf -- \
- $(EXTRA_TESTS_ENVIRONMENT)
-
-EXTRA_TESTS_ENVIRONMENT =
+ $(NULL)
check-valgrind:
$(MAKE) check-TESTS \
maybe_gc_friendly=,gc-friendly \
- TESTS_ENVIRONMENT="$(VALGRIND_TESTS_ENVIRONMENT)"
+ LOG_COMPILER="$(VALGRIND_LOG_COMPILER)"
include $(top_srcdir)/tools/valgrind.mk
-VALGRIND_TESTS_ENVIRONMENT = \
- $(TESTS_ENVIRONMENT) \
+VALGRIND_LOG_COMPILER = \
+ $(LOG_COMPILER) \
env G_SLICE=always-malloc CHECK_VERBOSE=1 \
$(top_builddir)/libtool --mode=execute \
- $(VALGRIND) --suppressions=$(top_srcdir)/tests/suppressions/tpl.supp $(VALGRIND_FLAGS)
+ $(VALGRIND) --suppressions=$(top_srcdir)/tests/suppressions/tpl.supp $(VALGRIND_FLAGS) \
+ $(NULL)
BUILT_SOURCES = \
dbus-1/session.conf \