1#!/bin/sh
2
3# exit if any subcommand return non-zero status
4set -e
5
6# Choose python version
7if test "x$1" = x-3; then
8	PYTHON=py3
9	shift
10elif test "x$1" = x-2; then
11	PYTHON=py2
12	shift
13fi
14test "x$PYTHON" = x && PYTHON=py
15
16# Find tests
17FILTERS=
18for arg in "$@"; do
19	test "x$FILTERS" != x && FILTERS="$FILTERS or "
20	FILTERS="$FILTERS$arg"
21done
22
23# Run tests
24if [ -z "$FILTERS" ]; then
25	tox --develop -e $PYTHON
26else
27	tox --develop -e $PYTHON -- -k "$FILTERS"
28fi
29