summaryrefslogtreecommitdiff
path: root/debian/tests/failing-tests-dbg
blob: 8b2247f966ec27ea262b8dd7403ef1ff0f72c5ad (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
75
#!/bin/sh

set -e

if [ "$(whoami)" = root ]; then
  if [ -n "$SUDO_USER" ] && getent passwd "$SUDO_USER" > /dev/null; then
    su_user="$SUDO_USER"
  else
    su_user=nobody
  fi

  if [ -e /etc/default/apport ]; then
    # stop apport
    service apport stop 2>/dev/null || true
    sed -i '/^enabled=/s/=.*/=0/' /etc/default/apport 2>/dev/null
  fi
fi

tmphome=$ADTTMP/home
mkdir -p $tmphome/.local/lib/python3.7/site-packages
if [ -n "$su_user" ]; then
  chmod go+rx $ADTTMP
  chown $su_user:nogroup $tmphome
fi
ls -la $ADTTMP

debian_dir=$(dirname $(dirname $0))

# no root access needed after this point

TESTPYTHON="python3.7dm -W default -bb -E -R -m test"
TESTEXCLUSIONS=""

. $debian_dir/tests/test-common.sh

if [ "$su_user" = nobody ]; then
  log=/dev/null
else
  log=testsuite-dbg.log
fi

script=$debian_dir/script.py
echo "Running the failing tests with the debug enabled interpreter:"
progressions=
for tst in $TESTEXCLUSIONS; do
  if [ -f "$script" ]; then
    cmd="HOME=$tmphome python3.7 $script \"$log\" \"$TESTPYTHON $TESTOPTS $tst\""
  else
    cmd="HOME=$tmphome $TESTPYTHON $TESTOPTS $tst"
  fi

  echo "Running $tst ..."
  if [ "$(whoami)" = root ]; then
    echo "su -s /bin/sh -c $cmd $su_user"
    if su -s /bin/sh -c "$cmd" $su_user; then
      progressions="$progressions $tst"
    else
      :
    fi
  else
    echo "$cmd"
    if eval $cmd; then
      progressions="$progressions $tst"
    else
      :
    fi
  fi
done

if [ -n "$progressions" ]; then
  echo "Tests run: $TESTEXCLUSIONS"
  echo "Progressions:$progressions"
fi

exit 0