From: Frank Brehm Date: Thu, 11 May 2017 08:31:08 +0000 (+0200) Subject: Adding test/run.sh X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=3158c5da09da30cc28c9dc33cfad297e10d003d4;p=pixelpark%2Ftrace-maillog.git Adding test/run.sh --- diff --git a/test/run.sh b/test/run.sh new file mode 100755 index 0000000..edc9e4d --- /dev/null +++ b/test/run.sh @@ -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