summaryrefslogtreecommitdiffstats
path: root/runtests.sh
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-14 11:37:31 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-14 11:37:31 -0700
commit724421343eb64987e054c255527e40be73162a83 (patch)
tree4148008ead3c2fbee007ade3fa90f434e4ddae9b /runtests.sh
parent3dd3d6ce35a04d16c955931e3108fd5211f323a1 (diff)
downloadportage-724421343eb64987e054c255527e40be73162a83.tar.gz
portage-724421343eb64987e054c255527e40be73162a83.tar.bz2
portage-724421343eb64987e054c255527e40be73162a83.zip
Add support for NOCOLOR variable.
Diffstat (limited to 'runtests.sh')
-rwxr-xr-xruntests.sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/runtests.sh b/runtests.sh
index 1afbfb3f4..2ba05e3e2 100755
--- a/runtests.sh
+++ b/runtests.sh
@@ -2,12 +2,25 @@
PYTHON_VERSIONS="2.6 2.7 3.1 3.2"
+case "${NOCOLOR:-false}" in
+ yes|true)
+ GOOD=
+ BAD=
+ NORMAL=
+ ;;
+ no|false)
+ GOOD=$'\e[1;32m'
+ BAD=$'\e[1;31m'
+ NORMAL=$'\e[0m'
+ ;;
+esac
+
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"
+ echo -e "${GOOD}Testing with Python ${version}...${NORMAL}"
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"
+ echo -e "${BAD}Testing with Python ${version} failed${NORMAL}"
exit_status="1"
fi
echo