Permalink
Browse files

Testing shell script added for testing of python src (django mostly).

  • Loading branch information...
1 parent 38114d1 commit 7f23d0d17dcd5d764df2c7ed6b530498ae682c21 @clemesha-ooi clemesha-ooi committed Feb 9, 2010
Showing with 27 additions and 9 deletions.
  1. +0 −8 web/src/python/README
  2. +1 −1 web/src/python/nimbusweb/portal/settings.py
  3. +26 −0 web/src/python/run-tests.sh
View
@@ -1,8 +0,0 @@
-TODO: should this file go here?
-
-
-Running tests
--------------
-
-Example: test only the "nimbus" app test:
- $ python nimbusweb/portal/manage.py test nimbus --pythonpath="."
@@ -63,7 +63,7 @@
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
- #'cpserver',
+ 'cpserver',
'nimbusweb.portal.nimbus',
'nimbusweb.portal.usercreate',
)
@@ -0,0 +1,26 @@
+# Usage:
+#
+# $ ./run-tests.sh django-app-name-to-test
+#
+# If you do not specify an app name, all test will run.
+# TODO: let '--verbosity' be passed in as an argument.
+#
+PYTHON_EXE="/usr/bin/env python"
+
+NIMBUS_WEBDIR_REL="`dirname $0`/../.."
+NIMBUS_WEBDIR=`cd $NIMBUS_WEBDIR_REL; pwd`
+
+NIMBUS_WEBCONF="$NIMBUS_WEBDIR/nimbusweb.conf"
+if [ ! -f "$NIMBUS_WEBCONF" ]; then
+ echo ""
+ echo "Cannot find conf file, exiting. (expected at '$NIMBUS_WEBCONF')"
+ exit 1
+fi
+
+NIMBUS_PYLIB="$NIMBUS_WEBDIR/lib/python"
+NIMBUS_PYSRC="$NIMBUS_WEBDIR/src/python"
+
+PYTHONPATH="$NIMBUS_PYSRC:$NIMBUS_PYLIB:$PYTHONPATH"
+export PYTHONPATH
+
+$PYTHON_EXE $NIMBUS_PYSRC/nimbusweb/portal/manage.py test --verbosity=2 $1

0 comments on commit 7f23d0d

Please sign in to comment.