Commit | Line | Data |
---|---|---|
188240e3 CAW |
1 | #!/bin/sh |
2 | ||
3 | # GNU MediaGoblin -- federated, autonomous media hosting | |
7f4ebeed | 4 | # Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. |
188240e3 CAW |
5 | # |
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. | |
10 | # | |
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. | |
15 | # | |
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/>. | |
18 | ||
8b271c28 E |
19 | basedir="`dirname $0`" |
20 | # Directory to seaerch for: | |
21 | subdir="mediagoblin/tests" | |
22 | [ '!' -d "$basedir/$subdir" ] && basedir="." | |
23 | if [ '!' -d "$basedir/$subdir" ] | |
24 | then | |
25 | echo "Could not find base directory" >&2 | |
26 | exit 1 | |
27 | fi | |
28 | ||
29 | if [ -x "$basedir/bin/nosetests" ]; then | |
30 | export NOSETESTS="$basedir/bin/nosetests"; | |
31 | echo "Using $NOSETESTS"; | |
188240e3 CAW |
32 | elif which nosetests > /dev/null; then |
33 | echo "Using nosetests from \$PATH"; | |
34 | export NOSETESTS="nosetests"; | |
35 | else | |
528c8b8f WKG |
36 | echo "nosetests not found. X_X"; |
37 | echo "Please install 'nose'. Exiting."; | |
188240e3 CAW |
38 | exit 1 |
39 | fi | |
40 | ||
7dec9f92 E |
41 | need_arg=1 |
42 | for i in "$@" | |
43 | do | |
44 | case "$i" in | |
45 | -*) ;; | |
46 | *) need_arg=0; break ;; | |
47 | esac | |
48 | done | |
49 | ||
7dec9f92 E |
50 | CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_tests |
51 | export CELERY_CONFIG_MODULE | |
8b271c28 | 52 | echo "+ CELERY_CONFIG_MODULE=$CELERY_CONFIG_MODULE" |
7dec9f92 E |
53 | |
54 | if [ "$need_arg" = 1 ] | |
55 | then | |
8b271c28 E |
56 | testdir="$basedir/mediagoblin/tests" |
57 | set -x | |
58 | exec "$NOSETESTS" "$@" "$testdir" | |
7dec9f92 | 59 | else |
8b271c28 E |
60 | set -x |
61 | exec "$NOSETESTS" "$@" | |
7dec9f92 | 62 | fi |