3 # GNU MediaGoblin Selenium Automation
4 # Copyright (C) 2013 Emily O'Leary
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU Affero General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU Affero General Public License for more details.
16 # You should have received a copy of the GNU Affero General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #Note: This will change once made into a parameter.
24 while getopts tests: name
29 ?) echo "Usage: $0: [-tests value]"
34 if [ -x "$basedir/mediagoblin/bin/py.test" ]; then
35 export PYTEST="$basedir/mediagoblin/bin/py.test";
37 elif which py.test > /dev/null; then
38 echo "Using py.test from \$PATH";
39 export PYTEST="py.test";
41 echo "py.test not found. X_X";
42 echo "Please install 'py.test'. Exiting.";
46 $basedir/mediagoblin/lazyserver.sh&
52 testdir="$basedir/tests"
55 rm -f $basedir/run/*.py
56 rm -f $basedir/run/util/*.py
58 for f in $testdir/*.py
60 m4 -DWORKING_DIRECTORY="$basedir" $f > $basedir/run/$(basename "$f")
62 for f in $testdir/util/*.py
64 m4 -DWORKING_DIRECTORY="$basedir" $f > $basedir/run/util/$(basename "$f")
67 source $basedir/mediagoblin/bin/activate
69 $basedir/scripts/setupTests.py --working=$basedir --data=$data
71 exec "$PYTEST" "$basedir/run" --boxed