summaryrefslogtreecommitdiffstats
path: root/runtests.sh
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-01-01 04:24:14 -0800
committerZac Medico <zmedico@gentoo.org>2013-01-01 04:24:14 -0800
commite1765ca490428c2fc4c1bf2d414c2174c402b85c (patch)
tree6dfdd08ff0fa1765772d77bad85f67e3e3cd240c /runtests.sh
parent83cfc04df383b56592b89f1dc58428c0e8d09925 (diff)
downloadportage-e1765ca490428c2fc4c1bf2d414c2174c402b85c.tar.gz
portage-e1765ca490428c2fc4c1bf2d414c2174c402b85c.tar.bz2
portage-e1765ca490428c2fc4c1bf2d414c2174c402b85c.zip
runtests.sh: summarize results for all versions
Diffstat (limited to 'runtests.sh')
-rwxr-xr-xruntests.sh31
1 files changed, 30 insertions, 1 deletions
diff --git a/runtests.sh b/runtests.sh
index 25389b8d8..6dc0c4005 100755
--- a/runtests.sh
+++ b/runtests.sh
@@ -49,6 +49,8 @@ set -- "${unused_args[@]}"
eprefix=${PORTAGE_OVERRIDE_EPREFIX}
exit_status="0"
+found_versions=()
+status_array=()
for version in ${PYTHON_VERSIONS}; do
if [[ $version =~ ^([[:digit:]]+\.[[:digit:]]+)-pypy-([[:digit:]]+\.[[:digit:]]+)$ ]] ; then
executable=${eprefix}/usr/bin/pypy-c${BASH_REMATCH[2]}
@@ -57,7 +59,11 @@ for version in ${PYTHON_VERSIONS}; do
fi
if [[ -x "${executable}" ]]; then
echo -e "${GOOD}Testing with Python ${version}...${NORMAL}"
- if ! "${executable}" -Wd pym/portage/tests/runTests "$@" ; then
+ "${executable}" -Wd pym/portage/tests/runTests "$@"
+ status=$?
+ status_array[${#status_array[@]}]=${status}
+ found_versions[${#found_versions[@]}]=${version}
+ if [ ${status} -ne 0 ] ; then
echo -e "${BAD}Testing with Python ${version} failed${NORMAL}"
exit_status="1"
fi
@@ -65,4 +71,27 @@ for version in ${PYTHON_VERSIONS}; do
fi
done
+if [ ${#status_array[@]} -gt 0 ] ; then
+ max_len=0
+ for version in ${found_versions[@]} ; do
+ [ ${#version} -gt ${max_len} ] && max_len=${#version}
+ done
+ (( columns = max_len + 2 ))
+ printf "\nSummary:\n\n"
+ printf "| %-${columns}s | %s\n|" "Version" "Status"
+ (( total_cols = columns + 11 ))
+ eval "printf -- '-%.0s' {1..${total_cols}}"
+ printf "\n"
+ row=0
+ for version in ${found_versions[@]} ; do
+ if [ ${status_array[${row}]} -eq 0 ] ; then
+ status="success"
+ else
+ status="fail"
+ fi
+ printf "| %-${columns}s | %s\n" "${version}" "${status}"
+ (( row++ ))
+ done
+fi
+
exit ${exit_status}