blob: f10c1b01d94f20b3bbf2b40c6f30eb584f9dc418 [file] [log] [blame]
Haibo Huang8b3c57b2018-07-03 17:43:11 -07001#!/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
Elliott Hughes69c9aca2018-10-30 14:11:58 -07008 PYTHON=py3
Haibo Huang8b3c57b2018-07-03 17:43:11 -07009 shift
10elif test "x$1" = x-2; then
Elliott Hughes69c9aca2018-10-30 14:11:58 -070011 PYTHON=py2
Haibo Huang8b3c57b2018-07-03 17:43:11 -070012 shift
13fi
Elliott Hughes69c9aca2018-10-30 14:11:58 -070014test "x$PYTHON" = x && PYTHON=py
Haibo Huang8b3c57b2018-07-03 17:43:11 -070015
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
Elliott Hughes69c9aca2018-10-30 14:11:58 -070025 tox --develop -e $PYTHON
Haibo Huang8b3c57b2018-07-03 17:43:11 -070026else
Elliott Hughes69c9aca2018-10-30 14:11:58 -070027 tox --develop -e $PYTHON -- -k "$FILTERS"
Haibo Huang8b3c57b2018-07-03 17:43:11 -070028fi