From 7dec9f92f345df4bb33d399f60c49544c7e60bf6 Mon Sep 17 00:00:00 2001 From: Elrond Date: Thu, 10 Jan 2013 22:34:52 +0100 Subject: [PATCH] issue 355: Only run tests in mediagoblin/tests/ 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. --- runtests.sh | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/runtests.sh b/runtests.sh index 94e77da2..ccba1abd 100755 --- a/runtests.sh +++ b/runtests.sh @@ -28,4 +28,29 @@ else 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 -- 2.25.1