2015-03-03 09:57:41 -08:00
|
|
|
#!/bin/sh
|
2015-04-15 17:41:12 -07:00
|
|
|
|
2015-12-11 16:10:51 +00:00
|
|
|
# exit if any subcommand return non-zero status
|
|
|
|
set -e
|
|
|
|
|
2015-04-15 17:41:12 -07:00
|
|
|
# Choose python version
|
|
|
|
if test "x$1" = x-3; then
|
|
|
|
PYTHON=python3
|
|
|
|
shift
|
|
|
|
elif test "x$1" = x-2; then
|
|
|
|
PYTHON=python2
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
test "x$PYTHON" = x && PYTHON=python
|
|
|
|
|
|
|
|
# Find tests
|
2016-02-06 21:53:01 +00:00
|
|
|
FILTERS=
|
2015-04-19 11:53:35 -07:00
|
|
|
for arg in "$@"; do
|
2016-02-06 21:53:01 +00:00
|
|
|
test "x$FILTERS" != x && FILTERS="$FILTERS or "
|
|
|
|
FILTERS="$FILTERS$arg"
|
2015-04-19 04:56:08 -07:00
|
|
|
done
|
|
|
|
|
2016-02-06 21:53:01 +00:00
|
|
|
# Run tests
|
|
|
|
if [ -z "$FILTERS" ]; then
|
|
|
|
$PYTHON -m pytest
|
2015-04-21 11:06:56 -07:00
|
|
|
else
|
2016-02-06 21:53:01 +00:00
|
|
|
$PYTHON -m pytest -k "$FILTERS"
|
2015-03-03 10:39:55 -08:00
|
|
|
fi
|