2 # Copyright 2010-2012 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_VERSIONS="2.6 2.7 2.7-pypy-1.8 2.7-pypy-1.9 3.1 3.2 3.3 3.4"
7 # has to be run from portage root dir
10 case "${NOCOLOR:-false}" in
24 echo "interrupted." >&2
28 trap interrupted SIGINT
32 while [ $# -gt 0 ] ; do
35 PYTHON_VERSIONS=${1#--python-versions=}
42 unused_args[${#unused_args[@]}]=$1
48 set -- "${unused_args[@]}"
50 eprefix=${PORTAGE_OVERRIDE_EPREFIX}
52 for version in ${PYTHON_VERSIONS}; do
53 if [[ $version =~ ^([[:digit:]]+\.[[:digit:]]+)-pypy-([[:digit:]]+\.[[:digit:]]+)$ ]] ; then
54 executable=${eprefix}/usr/bin/pypy-c${BASH_REMATCH[2]}
56 executable=${eprefix}/usr/bin/python${version}
58 if [[ -x "${executable}" ]]; then
59 echo -e "${GOOD}Testing with Python ${version}...${NORMAL}"
60 if ! "${executable}" -Wd pym/portage/tests/runTests "$@" ; then
61 echo -e "${BAD}Testing with Python ${version} failed${NORMAL}"