From 8f7868f7911614023b6ca2af36e811d9d15b3b6f Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 12 Sep 2013 14:19:50 +0200 Subject: [PATCH 3/4] Run regression tests under the run-test.sh "driver" https://bugs.freedesktop.org/show_bug.cgi?id=69269 --- tests/twisted/Makefile.am | 53 ++++++++++++++++++++++++++++++++------------ tests/twisted/run-test.sh.in | 38 +++++++++++++++---------------- 2 files changed, 58 insertions(+), 33 deletions(-) diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am index 89b9c14..36ae8bd 100644 --- a/tests/twisted/Makefile.am +++ b/tests/twisted/Makefile.am @@ -25,20 +25,22 @@ TWISTED_TESTS = \ text/test-text.py -TESTS = - -TESTS_ENVIRONMENT = \ - PYTHONPATH=@abs_top_srcdir@/tests/twisted:@abs_top_builddir@/tests/twisted - check-local: check-twisted -check-twisted: - rm -f ../haze-testing.log - sh $(top_srcdir)/tests/twisted/tools/with-session-bus.sh \ - --config-file=$(top_builddir)/tests/twisted/tools/tmp-session-bus.conf \ - -- $(MAKE) check-TESTS \ - TESTS="$(TWISTED_TESTS)" \ - TESTS_ENVIRONMENT="$(TESTS_ENVIRONMENT) $(TEST_PYTHON)" +CHECK_TWISTED_SLEEP=0 + +check-twisted: $(BUILT_SOURCES) + $(MAKE) -C tools + if test "x$(CHECK_TWISTED_SLEEP)" = x0; then \ + haze_test_sleep= ; \ + else \ + haze_test_sleep=--sleep=$(CHECK_TWISTED_SLEEP); \ + fi; \ + HAZE_TEST_UNINSTALLED=1 \ + HAZE_ABS_TOP_SRCDIR=@abs_top_srcdir@ \ + HAZE_ABS_TOP_BUILDDIR=@abs_top_builddir@ \ + HAZE_TEST_SLEEP=$$haze_test_sleep \ + ./run-test.sh "$(TWISTED_TESTS)" EXTRA_DIST = \ $(TWISTED_TESTS) \ @@ -60,6 +62,29 @@ config.py: Makefile echo "MEDIA_ENABLED = $(MEDIA_ENABLED_PYBOOL)"; \ } > $@ -BUILT_SOURCES = config.py +haze-twisted-tests.list: Makefile + $(AM_V_GEN)echo $(TWISTED_TESTS) > $@ + +BUILT_SOURCES = \ + config.py \ + haze-twisted-tests.list \ + run-test.sh \ + $(NULL) + +# We don't really use hazetestsdir yet - we only support uninstalled testing +# so far - but I'm substituting it to keep the script more similar to Gabble's. +# ${pkglibexecdir}/tests is what GNOME's InstalledTests goal recommends. +run-test.sh: run-test.sh.in Makefile + $(AM_V_GEN)sed \ + -e 's![@]hazetestsdir[@]!${pkglibexecdir}/tests!' \ + -e 's![@]TEST_PYTHON[@]!$(TEST_PYTHON)!' \ + < $< > $@.tmp && \ + chmod +x $@.tmp && \ + mv $@.tmp $@ -CLEANFILES = *.pyc */*.pyc config.py +CLEANFILES = \ + $(BUILT_SOURCES) \ + haze-[1-9]*.log \ + *.pyc \ + */*.pyc \ + $(NULL) diff --git a/tests/twisted/run-test.sh.in b/tests/twisted/run-test.sh.in index 8dd5fd6..11bbaf9 100644 --- a/tests/twisted/run-test.sh.in +++ b/tests/twisted/run-test.sh.in @@ -1,53 +1,53 @@ #!/bin/sh -if test "x$GABBLE_TEST_UNINSTALLED" = x; then - script_fullname=`readlink -e "@gabbletestsdir@/twisted/run-test.sh"` +if test "x$HAZE_TEST_UNINSTALLED" = x; then + script_fullname=`readlink -e "@hazetestsdir@/twisted/run-test.sh"` if [ `readlink -e "$0"` != "$script_fullname" ] ; then echo "This script is meant to be installed at $script_fullname" >&2 exit 1 fi - test_src="@gabbletestsdir@" - test_build="@gabbletestsdir@" - config_file="@gabbletestsdir@/twisted/tools/servicedir/tmp-session-bus.conf" + test_src="@hazetestsdir@" + test_build="@hazetestsdir@" + config_file="@hazetestsdir@/twisted/tools/servicedir/tmp-session-bus.conf" - PYTHONPATH="@gabbletestsdir@/twisted" + PYTHONPATH="@hazetestsdir@/twisted" export PYTHONPATH - GABBLE_TWISTED_PATH="@gabbletestsdir@/twisted" - export GABBLE_TWISTED_PATH + HAZE_TWISTED_PATH="@hazetestsdir@/twisted" + export HAZE_TWISTED_PATH else - if test -z "$GABBLE_ABS_TOP_SRCDIR"; then - echo "GABBLE_ABS_TOP_SRCDIR must be set" >&2 + if test -z "$HAZE_ABS_TOP_SRCDIR"; then + echo "HAZE_ABS_TOP_SRCDIR must be set" >&2 exit 1 fi - if test -z "$GABBLE_ABS_TOP_BUILDDIR"; then - echo "GABBLE_ABS_TOP_BUILDDIR must be set" >&2 + if test -z "$HAZE_ABS_TOP_BUILDDIR"; then + echo "HAZE_ABS_TOP_BUILDDIR must be set" >&2 exit 1 fi - test_src="${GABBLE_ABS_TOP_SRCDIR}/tests" - test_build="${GABBLE_ABS_TOP_BUILDDIR}/tests" - config_file="${test_build}/twisted/tools/servicedir-uninstalled/tmp-session-bus.conf" + test_src="${HAZE_ABS_TOP_SRCDIR}/tests" + test_build="${HAZE_ABS_TOP_BUILDDIR}/tests" + config_file="${test_build}/twisted/tools/tmp-session-bus.conf" PYTHONPATH="${test_src}/twisted:${test_build}/twisted" export PYTHONPATH - GABBLE_TWISTED_PATH="${test_src}/twisted" - export GABBLE_TWISTED_PATH + HAZE_TWISTED_PATH="${test_src}/twisted" + export HAZE_TWISTED_PATH fi if [ -n "$1" ] ; then list="$1" else - list=$(cat "${test_build}"/twisted/gabble-twisted-tests.list) + list=$(cat "${test_build}"/twisted/haze-twisted-tests.list) fi any_failed=0 for i in $list ; do echo "Testing $i ..." sh "${test_src}/twisted/tools/with-session-bus.sh" \ - ${GABBLE_TEST_SLEEP} \ + ${HAZE_TEST_SLEEP} \ --config-file="${config_file}" \ -- \ @TEST_PYTHON@ -u "${test_src}/twisted/$i" -- 1.8.3.1