File: run-tests

package info (click to toggle)
software-properties 0.111-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,944 kB
  • sloc: python: 8,238; makefile: 19; sh: 18; xml: 10
file content (26 lines) | stat: -rwxr-xr-x 641 bytes parent folder | download
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
#!/bin/sh

set -e

tmpdir="$(mktemp -d)"
cleanup () {
	rm -rf "$tmpdir"
}
trap cleanup EXIT HUP INT QUIT TERM

# This is a bit nasty, but at least tests/test_dbus.py relies on being run
# in a UTF-8 locale.  Override this for now, but it might be better to make
# the test work in other locales too.
export LC_ALL=C.UTF-8

code=0
if [ "$TMPDIR" ]; then
	env -u TMPDIR xvfb-run -e "$tmpdir/xvfb.log" sh -ec "TMPDIR=\"$TMPDIR\" pytest tests/test_*.py" || code="$?"
else
	xvfb-run -e "$tmpdir/xvfb.log" sh -ec "pytest tests/test_*.py" || code="$?"
fi
if [ "$code" != 0 ]; then
	echo "xauth/Xrdb output:"
	cat "$tmpdir/xvfb.log"
fi
exit "$code"