Fixes and error detection for runtests.sh
authorJeff Quast <contact@jeffquast.com>
Mon, 24 Nov 2014 02:43:49 +0000 (18:43 -0800)
committerJeff Quast <contact@jeffquast.com>
Mon, 24 Nov 2014 02:43:49 +0000 (18:43 -0800)
tools/teamcity-runtests.sh

index ff89c9d03a8c427f76d62ecce124ddd8f74f5c4c..e39f15f4c23f72465f9abbe0490ce0287515eb7f 100755 (executable)
@@ -5,21 +5,24 @@
 set -e
 set -o pipefail
 
-function usage() {
-       echo "$0 (2.6|2.7|3.3|3.4)"
-}
 if [ -z $1 ]; then
-       usage
+       echo "$0 (2.6|2.7|3.3|3.4)"
        exit 1
 fi
 
 pyversion=$1
 here=$(cd `dirname $0`; pwd)
 osrel=$(uname -s)
+venv=teamcity-pexpect
+venv_wrapper=$(which virtualenvwrapper.sh)
+
+if [ -z $venv_wrapper ]; then
+       echo "virtualenvwrapper.sh not found in PATH."
+fi
 
-. `which virtualenvwrapper.sh`
-rmvirtualenv teamcity-pexpect || true
-mkvirtualenv -p `which python${pyversion}` teamcity-pexpect
+. ${venv_wrapper}
+rmvirtualenv ${venv} || true
+mkvirtualenv -p `which python${pyversion}` ${venv} || true
 
 # install ptyprocess
 cd $here/../../ptyprocess