Commits

Doug Hellmann committed 5e3b2c6

update installation test

Comments (0)

Files changed (2)

 # Testing
 TEST_SCRIPTS=$(wildcard tests/test*.sh)
 
-.PHONY: test test-bash test-sh test-zsh test-loop
-test: test-bash test-sh test-zsh
+.PHONY: test test-bash test-sh test-zsh test-loop test-install
+test: test-bash test-sh test-zsh test-install
 
 test-bash:
 	TEST_SHELL=bash $(MAKE) test-loop
 		SHUNIT_PARENT=$$test_script $(TEST_SHELL) $$test_script ; \
 		echo ; \
 	done
+
+test-install:
+	bash ./tests/manual_test_install.sh `pwd`/dist "$(VERSION)"

tests/manual_test_install.sh

 #
 
 test_dir=$(dirname $0)
-dist_dir="$1"
-version="$2"
+source "$test_dir/../virtualenvwrapper_bashrc"
 
 export WORKON_HOME="${TMPDIR:-/tmp}/WORKON_HOME"
-mkvirtualenv "installtest"
-pip install "$dist_dir/virtualenvwrapper-$version.tar.gz"
-RC=$?
 
-rm -rf "$WORKON_HOME"
-exit $RC
+VERSION=$(python setup.py --version)
+
+oneTimeSetUp() {
+    rm -rf "$WORKON_HOME"
+    mkdir -p "$WORKON_HOME"
+    mkvirtualenv "installtest"
+}
+
+oneTimeTearDown() {
+    rm -rf "$WORKON_HOME"
+}
+
+setUp () {
+    echo
+}
+
+test_install () {
+    dist_dir=$(dirname $test_dir)/dist
+    pip install "$dist_dir/virtualenvwrapper-$VERSION.tar.gz"
+    RC=$?
+    assertTrue "Error code $RC" "[ $RC -eq 0 ]"
+    assertTrue "Missing wrapper script" "[ -f $WORKON_HOME/installtest/bin/virtualenvwrapper_bashrc ]"
+}
+
+. "$test_dir/shunit2"