diff options
| author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2013-01-10 22:34:52 +0100 | 
|---|---|---|
| committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2013-01-11 16:28:41 +0100 | 
| commit | 7dec9f92f345df4bb33d399f60c49544c7e60bf6 (patch) | |
| tree | 960a06c4ef83c4ae26b3e73143e607dee2b2f54f | |
| parent | a3b98853df71a00d8aba0d641ee57a265238d95e (diff) | |
| download | mediagoblin-7dec9f92f345df4bb33d399f60c49544c7e60bf6.tar.lz mediagoblin-7dec9f92f345df4bb33d399f60c49544c7e60bf6.tar.xz mediagoblin-7dec9f92f345df4bb33d399f60c49544c7e60bf6.zip | |
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.
| -rwxr-xr-x | runtests.sh | 27 | 
1 files changed, 26 insertions, 1 deletions
| 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 | 
