summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2013-09-11 11:08:42 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2013-09-11 11:08:42 +0200
commit69a6d16d56b45f56d70924648511e20170c8e11d (patch)
tree6747e43be86946dd80cbd21292d29b6bfd5e3bf4 /tests
parent19c915555613d646212fdfa55ae0d5aa8060df8c (diff)
downloadufo-filters-69a6d16d56b45f56d70924648511e20170c8e11d.tar.gz
ufo-filters-69a6d16d56b45f56d70924648511e20170c8e11d.tar.bz2
ufo-filters-69a6d16d56b45f56d70924648511e20170c8e11d.tar.xz
ufo-filters-69a6d16d56b45f56d70924648511e20170c8e11d.zip
Add test runner script
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runtests.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/runtests.sh b/tests/runtests.sh
new file mode 100755
index 0000000..c4e9bee
--- /dev/null
+++ b/tests/runtests.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+CUR=$(pwd)
+
+if [ ! -d "$CUR/venv" ]; then
+ echo "* Creating virtualenv ..."
+ virtualenv --system-site-packages -q $CUR/venv
+fi
+
+echo "* Activate virtualenv ..."
+source $CUR/venv/bin/activate
+
+# Install nose if not available
+pip freeze | grep nose > /dev/null
+RC=$?
+
+if [ "$RC" -ne "0" ]; then
+ echo "* Installing nose ..."
+ pip install nose nose-parameterized
+fi
+
+# Install unittest2 if Python less than 2.7
+python -c 'import sys; v=sys.version_info; sys.exit((v[0], v[1]) < (2,7))'
+RC=$?
+
+if [ "$RC" -ne "0" ]; then
+ pip freeze | grep unittest2 > /dev/null
+ RC=$?
+
+ if [ "$RC" -ne "0" ]; then
+ echo "* Installing unittest2 ..."
+ pip install unittest2
+ fi
+fi
+
+echo "* Running tests ..."
+export CUDA_VISIBLE_DEVICES=0,1
+nosetests tests.py