Skip to content

Commit 5e3b2c6

Browse files
committed
update installation test
1 parent 0baa49a commit 5e3b2c6

File tree

2 files changed

+31
-9
lines changed

2 files changed

+31
-9
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ docs/sphinx/web/templates/base.html: ~/Devel/doughellmann/doughellmann/templates
2929
# Testing
3030
TEST_SCRIPTS=$(wildcard tests/test*.sh)
3131

32-
.PHONY: test test-bash test-sh test-zsh test-loop
33-
test: test-bash test-sh test-zsh
32+
.PHONY: test test-bash test-sh test-zsh test-loop test-install
33+
test: test-bash test-sh test-zsh test-install
3434

3535
test-bash:
3636
TEST_SHELL=bash $(MAKE) test-loop
@@ -48,3 +48,6 @@ test-loop:
4848
SHUNIT_PARENT=$$test_script $(TEST_SHELL) $$test_script ; \
4949
echo ; \
5050
done
51+
52+
test-install:
53+
bash ./tests/manual_test_install.sh `pwd`/dist "$(VERSION)"

tests/manual_test_install.sh

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,32 @@
44
#
55

66
test_dir=$(dirname $0)
7-
dist_dir="$1"
8-
version="$2"
7+
source "$test_dir/../virtualenvwrapper_bashrc"
98

109
export WORKON_HOME="${TMPDIR:-/tmp}/WORKON_HOME"
11-
mkvirtualenv "installtest"
12-
pip install "$dist_dir/virtualenvwrapper-$version.tar.gz"
13-
RC=$?
1410

15-
rm -rf "$WORKON_HOME"
16-
exit $RC
11+
VERSION=$(python setup.py --version)
12+
13+
oneTimeSetUp() {
14+
rm -rf "$WORKON_HOME"
15+
mkdir -p "$WORKON_HOME"
16+
mkvirtualenv "installtest"
17+
}
18+
19+
oneTimeTearDown() {
20+
rm -rf "$WORKON_HOME"
21+
}
22+
23+
setUp () {
24+
echo
25+
}
26+
27+
test_install () {
28+
dist_dir=$(dirname $test_dir)/dist
29+
pip install "$dist_dir/virtualenvwrapper-$VERSION.tar.gz"
30+
RC=$?
31+
assertTrue "Error code $RC" "[ $RC -eq 0 ]"
32+
assertTrue "Missing wrapper script" "[ -f $WORKON_HOME/installtest/bin/virtualenvwrapper_bashrc ]"
33+
}
34+
35+
. "$test_dir/shunit2"

0 commit comments

Comments
 (0)