If you don't give an option argument (starting with a dash)
to runtests.sh then it will append the directory with all
the tests to the commandline of nosetests. That way it will
only search there for tests.
exit 1
fi
-CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_tests $NOSETESTS $@
+need_arg=1
+for i in "$@"
+do
+ case "$i" in
+ -*) ;;
+ *) need_arg=0; break ;;
+ esac
+done
+
+
+CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_tests
+export CELERY_CONFIG_MODULE
+
+if [ "$need_arg" = 1 ]
+then
+ dir="`dirname $0`"/mediagoblin/tests
+ [ '!' -d "$dir" ] && dir=./mediagoblin/tests
+ if [ '!' -d "$dir" ]
+ then
+ echo "Cound not find tests dir"
+ exit 1
+ fi
+ $NOSETESTS "$@" "$dir"
+else
+ $NOSETESTS "$@"
+fi