Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: /
Date: Tue, 01 Jan 2013 12:26:17
Message-Id: 1357043054.e1765ca490428c2fc4c1bf2d414c2174c402b85c.zmedico@gentoo
1 commit: e1765ca490428c2fc4c1bf2d414c2174c402b85c
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 1 12:24:14 2013 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 1 12:24:14 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e1765ca4
7
8 runtests.sh: summarize results for all versions
9
10 ---
11 runtests.sh | 31 ++++++++++++++++++++++++++++++-
12 1 files changed, 30 insertions(+), 1 deletions(-)
13
14 diff --git a/runtests.sh b/runtests.sh
15 index 25389b8..6dc0c40 100755
16 --- a/runtests.sh
17 +++ b/runtests.sh
18 @@ -49,6 +49,8 @@ set -- "${unused_args[@]}"
19
20 eprefix=${PORTAGE_OVERRIDE_EPREFIX}
21 exit_status="0"
22 +found_versions=()
23 +status_array=()
24 for version in ${PYTHON_VERSIONS}; do
25 if [[ $version =~ ^([[:digit:]]+\.[[:digit:]]+)-pypy-([[:digit:]]+\.[[:digit:]]+)$ ]] ; then
26 executable=${eprefix}/usr/bin/pypy-c${BASH_REMATCH[2]}
27 @@ -57,7 +59,11 @@ for version in ${PYTHON_VERSIONS}; do
28 fi
29 if [[ -x "${executable}" ]]; then
30 echo -e "${GOOD}Testing with Python ${version}...${NORMAL}"
31 - if ! "${executable}" -Wd pym/portage/tests/runTests "$@" ; then
32 + "${executable}" -Wd pym/portage/tests/runTests "$@"
33 + status=$?
34 + status_array[${#status_array[@]}]=${status}
35 + found_versions[${#found_versions[@]}]=${version}
36 + if [ ${status} -ne 0 ] ; then
37 echo -e "${BAD}Testing with Python ${version} failed${NORMAL}"
38 exit_status="1"
39 fi
40 @@ -65,4 +71,27 @@ for version in ${PYTHON_VERSIONS}; do
41 fi
42 done
43
44 +if [ ${#status_array[@]} -gt 0 ] ; then
45 + max_len=0
46 + for version in ${found_versions[@]} ; do
47 + [ ${#version} -gt ${max_len} ] && max_len=${#version}
48 + done
49 + (( columns = max_len + 2 ))
50 + printf "\nSummary:\n\n"
51 + printf "| %-${columns}s | %s\n|" "Version" "Status"
52 + (( total_cols = columns + 11 ))
53 + eval "printf -- '-%.0s' {1..${total_cols}}"
54 + printf "\n"
55 + row=0
56 + for version in ${found_versions[@]} ; do
57 + if [ ${status_array[${row}]} -eq 0 ] ; then
58 + status="success"
59 + else
60 + status="fail"
61 + fi
62 + printf "| %-${columns}s | %s\n" "${version}" "${status}"
63 + (( row++ ))
64 + done
65 +fi
66 +
67 exit ${exit_status}