Initial version of the mediagoblin-selenium tool chain.
[mediagoblin-automation:mediagoblin-selenium.git] / scripts / runtests.sh
1 #!/bin/bash
2 basedir=${PWD}
3 cd mediagoblin
4 tflag=0
5 while getopts tests: name
6 do
7     case $name in
8     branch) tflag=1
9             testdir="$OPTARG";;
10     ?)      echo "Usage: $0: [-tests value]"
11             exit 2;;
12     esac
13 done
14
15 if [ -x "$basedir/mediagoblin/bin/py.test" ]; then
16     export PYTEST="$basedir/mediagoblin//bin/py.test";
17     echo "Using $PYTEST";
18 elif which py.test > /dev/null; then
19     echo "Using py.test from \$PATH";
20     export PYTEST="py.test";
21 else
22     echo "py.test not found.  X_X";
23     echo "Please install 'py.test'.  Exiting.";
24     exit 1
25 fi
26
27 $basedir/mediagoblin/lazyserver.sh&
28
29 sleep 5s
30
31 if [ $tflag -ne 1 ]
32 then
33   testdir="$basedir/tests"
34 fi
35
36 set -x
37 exec "$PYTEST" "$testdir" --boxed