telepathy-rakia: Import run-test.sh.in from Gabble 0.18.1

Simon McVittie smcv at kemper.freedesktop.org
Tue Sep 10 04:31:58 PDT 2013


Module: telepathy-rakia
Branch: master
Commit: 2410db1bb1602cf2dc72a629c2a84b4e1629b6bb
URL:    http://cgit.freedesktop.org/telepathy/telepathy-rakia/commit/?id=2410db1bb1602cf2dc72a629c2a84b4e1629b6bb

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Wed Aug  7 16:30:27 2013 +0100

Import run-test.sh.in from Gabble 0.18.1

I'm copying it in verbatim, to make the changes made to adapt it to
Rakia easier to review.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65290
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=67872
Reviewed-by: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
[commit message previously said 'master' but 0.18.1's is identical -smcv]
Signed-off-by: Simon McVittie <simon.mcvittie at collabora.co.uk>

---

 tests/twisted/Makefile.am    |    1 +
 tests/twisted/run-test.sh.in |   69 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 70 insertions(+), 0 deletions(-)

diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am
index a0b30d6..a9f19a0 100644
--- a/tests/twisted/Makefile.am
+++ b/tests/twisted/Makefile.am
@@ -54,6 +54,7 @@ BUILT_SOURCES = config.py
 EXTRA_DIST = \
 	$(TWISTED_TESTS) \
 	constants.py \
+	run-test.sh.in \
 	sofiatest.py \
 	servicetest.py \
 	voip/voip_test.py
diff --git a/tests/twisted/run-test.sh.in b/tests/twisted/run-test.sh.in
new file mode 100644
index 0000000..8dd5fd6
--- /dev/null
+++ b/tests/twisted/run-test.sh.in
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+if test "x$GABBLE_TEST_UNINSTALLED" = x; then
+  script_fullname=`readlink -e "@gabbletestsdir@/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"
+
+  PYTHONPATH="@gabbletestsdir@/twisted"
+  export PYTHONPATH
+
+  GABBLE_TWISTED_PATH="@gabbletestsdir@/twisted"
+  export GABBLE_TWISTED_PATH
+else
+  if test -z "$GABBLE_ABS_TOP_SRCDIR"; then
+    echo "GABBLE_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
+    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"
+
+  PYTHONPATH="${test_src}/twisted:${test_build}/twisted"
+  export PYTHONPATH
+
+  GABBLE_TWISTED_PATH="${test_src}/twisted"
+  export GABBLE_TWISTED_PATH
+fi
+
+if [ -n "$1" ] ; then
+  list="$1"
+else
+  list=$(cat "${test_build}"/twisted/gabble-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} \
+    --config-file="${config_file}" \
+    -- \
+    @TEST_PYTHON@ -u "${test_src}/twisted/$i"
+  e=$?
+  case "$e" in
+    (0)
+      echo "PASS: $i"
+      ;;
+    (77)
+      echo "SKIP: $i"
+      ;;
+    (*)
+      any_failed=1
+      echo "FAIL: $i ($e)"
+      ;;
+  esac
+done
+
+exit $any_failed



More information about the telepathy-commits mailing list