11# Get the version of the app. This is used in the doc build.
22export VERSION =$(shell python setup.py --version)
33
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+
413# Default target is to show help
514help :
615 @echo " sdist - Source distribution"
@@ -44,7 +53,7 @@ docs/sphinx/web/templates/base.html: ~/Devel/doughellmann/doughellmann/templates
4453TEST_SCRIPTS =$(wildcard tests/test* .sh)
4554
4655.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
4857
4958develop :
5059 python setup.py develop
@@ -58,13 +67,26 @@ test-sh:
5867test-zsh :
5968 TEST_SHELL=" zsh -o shwordsplit" $(MAKE ) test-loop
6069
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
6174test-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 \
6786 done
6887
88+ test-quick :
89+ SUPPORTED_PYTHON_VERSIONS=$(PRIMARY_PYTHON_VERSION ) $(MAKE ) test-bash
90+
6991test-install :
7092 bash ./tests/manual_test_install.sh ` pwd` /dist " $( VERSION) "
0 commit comments