]> Frank Brehm's Git Trees - pixelpark/trace-maillog.git/commitdiff
Adding test/run.sh
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 11 May 2017 08:31:08 +0000 (10:31 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 11 May 2017 08:31:08 +0000 (10:31 +0200)
test/run.sh [new file with mode: 0755]

diff --git a/test/run.sh b/test/run.sh
new file mode 100755 (executable)
index 0000000..edc9e4d
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+set -e
+
+# ensure we can use unicode filenames in the test
+export LC_ALL=en_US.UTF-8
+THISDIR=$( dirname $0 )
+export PYTHONPATH="${THISDIR}/.."
+
+declare -a PYTHON_VERSIONS=( "2.4" "2.5" "2.6" "2.7" "3.1" "3.2" "3.3" "3.4" "3.5" "3.6" "3.7" )
+TESTED_ANYHOW="n"
+
+for VERSION in "${PYTHON_VERSIONS[@]}" ; do
+
+    PYTHON="python${VERSION}"
+    if [[ $( type -t "${PYTHON}" ) == 'file' ]] ; then
+        echo
+        echo "Testing ${PYTHON} ..."
+        TESTED_ANYHOW="y"
+        ${PYTHON} ${THISDIR}/test_magic.py "$@"
+    fi
+
+done
+
+if [[ "${TESTED_ANYHOW}" == 'n' ]] ; then
+    echo "Did not found an available Python version among ${PYTHON_VERSIONS[@]}." >&2
+    exit 5
+fi
+
+echo