summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Hupp <adam@hupp.org>2018-08-16 07:57:21 -0700
committerAdam Hupp <adam@hupp.org>2018-08-16 08:03:05 -0700
commit6102e9f56d93894c74413f43eaebb369f6df790f (patch)
tree39cff6de60bb64dffe0ea59c5bc48968cdeb4cb8
parent0850896fdc069c9671da157806072e6b1e15a124 (diff)
downloadpython-magic-6102e9f56d93894c74413f43eaebb369f6df790f.tar.gz
Make test runner handle missing python versions, based on a change from
Corin-EU
-rwxr-xr-xtest/run.sh15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/run.sh b/test/run.sh
index 8c687cb..529956f 100755
--- a/test/run.sh
+++ b/test/run.sh
@@ -1,12 +1,19 @@
#!/bin/sh
+set -e;
# ensure we can use unicode filenames in the test
export LC_ALL=en_US.UTF-8
THISDIR=`dirname $0`
export PYTHONPATH=${THISDIR}/..
-echo "python2.7"
-python2.7 ${THISDIR}/test.py
-echo "python3.0"
-python3 ${THISDIR}/test.py
+PYTHONS="python2.7 python3.5 bad"
+
+for pyver in $PYTHONS; do
+ if which $pyver > /dev/null; then
+ $pyver ${THISDIR}/test.py
+ else
+ echo "version $pyver not found"
+
+ fi
+done