aboutsummaryrefslogtreecommitdiffstats
path: root/run_unit_tests.sh
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-11-22 11:05:21 +0000
committerGerrit Code Review <gerrit@opnfv.org>2016-11-22 11:05:21 +0000
commit9d3211605b43daab86e30b2773c02209e5dd2d2d (patch)
tree4d3545d1482c62f3a9da3c1ac3cd2320b439e6e7 /run_unit_tests.sh
parentfdf8cd017eb17a1cf9eaeff7018cbb69e838b891 (diff)
parent23fa2fcb5517fafafe6e5263088ceddbb51c3d55 (diff)
Merge "Add Exceptions and Constants in opnfv module"
Diffstat (limited to 'run_unit_tests.sh')
-rwxr-xr-xrun_unit_tests.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/run_unit_tests.sh b/run_unit_tests.sh
new file mode 100755
index 0000000..df511ce
--- /dev/null
+++ b/run_unit_tests.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+set -o errexit
+set -o pipefail
+
+# Either Workspace is set (CI)
+if [ -z $WORKSPACE ]
+then
+ WORKSPACE="."
+fi
+
+
+# ***************
+# Run unit tests
+# ***************
+echo "Running unit tests..."
+
+# start vitual env
+virtualenv $WORKSPACE/modules_venv
+source $WORKSPACE/modules_venv/bin/activate
+
+# install python packages
+easy_install -U setuptools
+easy_install -U pip
+pip install $WORKSPACE
+
+
+# unit tests
+nosetests --with-xunit \
+ --cover-package=opnfv \
+ --with-coverage \
+ --cover-xml \
+ --cover-html \
+ tests/unit
+rc=$?
+
+deactivate