aboutsummaryrefslogtreecommitdiff
path: root/run-tests.sh
blob: f10c1b01d94f20b3bbf2b40c6f30eb584f9dc418 (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
#!/bin/sh

# exit if any subcommand return non-zero status
set -e

# Choose python version
if test "x$1" = x-3; then
	PYTHON=py3
	shift
elif test "x$1" = x-2; then
	PYTHON=py2
	shift
fi
test "x$PYTHON" = x && PYTHON=py

# Find tests
FILTERS=
for arg in "$@"; do
	test "x$FILTERS" != x && FILTERS="$FILTERS or "
	FILTERS="$FILTERS$arg"
done

# Run tests
if [ -z "$FILTERS" ]; then
	tox --develop -e $PYTHON
else
	tox --develop -e $PYTHON -- -k "$FILTERS"
fi