1
1
# Get the version of the app. This is used in the doc build.
2
2
export VERSION =$(shell python setup.py --version)
3
3
4
+ # The main version of Python supported.
5
+ PRIMARY_PYTHON_VERSION =2.6
6
+
7
+ # The test-quick pattern changes the definition of
8
+ # this variable to only run against a single version of python.
9
+ ifeq ($(SUPPORTED_PYTHON_VERSIONS ) ,)
10
+ SUPPORTED_PYTHON_VERSIONS =2.5 2.6
11
+ endif
12
+
4
13
# Default target is to show help
5
14
help :
6
15
@echo " sdist - Source distribution"
@@ -44,7 +53,7 @@ docs/sphinx/web/templates/base.html: ~/Devel/doughellmann/doughellmann/templates
44
53
TEST_SCRIPTS =$(wildcard tests/test* .sh)
45
54
46
55
.PHONY : develop test test-bash test-sh test-zsh test-loop test-install
47
- test : develop test-bash test-sh test-zsh test-install
56
+ test : test-bash test-sh test-zsh test-install
48
57
49
58
develop :
50
59
python setup.py develop
@@ -58,13 +67,26 @@ test-sh:
58
67
test-zsh :
59
68
TEST_SHELL=" zsh -o shwordsplit" $(MAKE ) test-loop
60
69
70
+ # For each supported version of Python,
71
+ # - Create a new virtualenv in a temporary directory.
72
+ # - Install virtualenvwrapper into the new virtualenv
73
+ # - Run each test script in tests
61
74
test-loop :
62
- @for test_script in $(wildcard tests/test* .sh) ; do \
63
- echo ' ********************************************************************************' ; \
64
- echo " Running $$ test_script with $( TEST_SHELL) " ; \
65
- SHUNIT_PARENT=$$ test_script $(TEST_SHELL ) $$ test_script || exit 1 ; \
66
- echo ; \
75
+ for py_ver in $( SUPPORTED_PYTHON_VERSIONS) ; do \
76
+ (cd $$ TMPDIR/ && rm -rf virtualenvwrapper-test-env \
77
+ && virtualenv -p /Library/Frameworks/Python.framework/Versions/$$ py_ver/bin/python$$ py_ver --no-site-packages virtualenvwrapper-test-env) \
78
+ || exit 1 ; \
79
+ $$ TMPDIR/virtualenvwrapper-test-env/bin/python setup.py install || exit 1 ; \
80
+ for test_script in $( wildcard tests/test* .sh) ; do \
81
+ echo ' ********************************************************************************' ; \
82
+ echo " Running $$ test_script with $( TEST_SHELL) under Python $$ py_ver" ; \
83
+ VIRTUALENVWRAPPER_PYTHON=$$ TMPDIR/virtualenvwrapper-test-env/bin/python SHUNIT_PARENT=$$ test_script $(TEST_SHELL ) $$ test_script || exit 1 ; \
84
+ echo ; \
85
+ done \
67
86
done
68
87
88
+ test-quick :
89
+ SUPPORTED_PYTHON_VERSIONS=$(PRIMARY_PYTHON_VERSION ) $(MAKE ) test-bash
90
+
69
91
test-install :
70
92
bash ./tests/manual_test_install.sh ` pwd` /dist " $( VERSION) "
0 commit comments