summaryrefslogtreecommitdiff
path: root/tests/twisted/run-test.sh.in
blob: 2d9f3ae81eda7cb41dffe8d86497023a422c3c87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh

if test "x$IDLE_TEST_UNINSTALLED" = x; then
  script_fullname=`readlink -e "@idletestsdir@/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="@idletestsdir@"
  test_build="@idletestsdir@"
  config_file="@idletestsdir@/twisted/tools/servicedir/tmp-session-bus.conf"

  PYTHONPATH="@idletestsdir@/twisted"
  export PYTHONPATH

  IDLE_TWISTED_PATH="@idletestsdir@/twisted"
  export IDLE_TWISTED_PATH
else
  if test -z "$IDLE_ABS_TOP_SRCDIR"; then
    echo "IDLE_ABS_TOP_SRCDIR must be set" >&2
    exit 1
  fi
  if test -z "$IDLE_ABS_TOP_BUILDDIR"; then
    echo "IDLE_ABS_TOP_BUILDDIR must be set" >&2
    exit 1
  fi

  test_src="${IDLE_ABS_TOP_SRCDIR}/tests"
  test_build="${IDLE_ABS_TOP_BUILDDIR}/tests"
  config_file="${test_build}/twisted/tools/tmp-session-bus.conf"

  PYTHONPATH="${test_src}/twisted:${test_build}/twisted"
  export PYTHONPATH

  IDLE_TWISTED_PATH="${test_src}/twisted"
  export IDLE_TWISTED_PATH
fi

IDLE_SSL_KEY=${IDLE_ABS_TOP_SRCDIR}/tests/twisted/tools/idletest.key
export IDLE_SSL_KEY
IDLE_SSL_CERT=${IDLE_ABS_TOP_SRCDIR}/tests/twisted/tools/idletest.cert
export IDLE_SSL_CERT

if [ -n "$1" ] ; then
  list="$1"
else
  list=$(cat "${test_build}"/twisted/idle-twisted-tests.list)
fi

any_failed=0
for i in $list ; do
  echo "Testing $i ..."
  sh "${test_src}/twisted/tools/with-session-bus.sh" \
    ${IDLE_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