Add a script, which simplifies testing with multiple versions of Python.
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Fri, 13 Aug 2010 22:41:28 +0000 (00:41 +0200)
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Fri, 13 Aug 2010 22:41:28 +0000 (00:41 +0200)
runtests.sh [new file with mode: 0755]

diff --git a/runtests.sh b/runtests.sh
new file mode 100755 (executable)
index 0000000..1afbfb3
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+PYTHON_VERSIONS="2.6 2.7 3.1 3.2"
+
+exit_status="0"
+for version in ${PYTHON_VERSIONS}; do
+       if [[ -x /usr/bin/python${version} ]]; then
+               echo -e "\e[1;32mTesting with Python ${version}...\e[0m"
+               if ! PYTHONPATH="pym${PYTHONPATH:+:}${PYTHONPATH}" /usr/bin/python${version} pym/portage/tests/runTests; then
+                       echo -e "\e[1;31mTesting with Python ${version} failed\e[0m"
+                       exit_status="1"
+               fi
+               echo
+       fi
+done
+
+exit ${exit_status}