dc3343fe9b7ec1d00a8630f30bcc0e2831575f45
[portage.git] / runtests.sh
1 #!/bin/bash
2
3 PYTHON_VERSIONS="2.6 2.7 3.1 3.2"
4
5 case "${NOCOLOR:-false}" in
6         yes|true)
7                 GOOD=
8                 BAD=
9                 NORMAL=
10                 ;;
11         no|false)
12                 GOOD=$'\e[1;32m'
13                 BAD=$'\e[1;31m'
14                 NORMAL=$'\e[0m'
15                 ;;
16 esac
17
18 interrupted() {
19         echo "interrupted." >&2
20         exit 1
21 }
22
23 trap interrupted SIGINT
24
25 exit_status="0"
26 for version in ${PYTHON_VERSIONS}; do
27         if [[ -x /usr/bin/python${version} ]]; then
28                 echo -e "${GOOD}Testing with Python ${version}...${NORMAL}"
29                 if ! /usr/bin/python${version} pym/portage/tests/runTests; then
30                         echo -e "${BAD}Testing with Python ${version} failed${NORMAL}"
31                         exit_status="1"
32                 fi
33                 echo
34         fi
35 done
36
37 exit ${exit_status}