* [gentoo-portage-dev] [PATCH 2/2] runtests: fix output for skipped pythons
@ 2016-03-19 21:29 Sergei Trofimovich
2016-03-20 13:53 ` Alexander Berntsen
2016-03-29 10:12 ` Alexander Berntsen
0 siblings, 2 replies; 4+ messages in thread
From: Sergei Trofimovich @ 2016-03-19 21:29 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Sergei Trofimovich
From: Sergei Trofimovich <siarheit@google.com>
I have Pythons 2.7 and 3.4 installed.
Before the patch I had the following output:
$ ./runtests pym/portage/tests/resolver/test_blocker.py
Testing with Python 2.7...
Testing with Python 3.4...
Summary:
| Version | Status
|--------------------
| 2.7 | PASS
| 3.3 | PASS
After the patch:
$ ./runtests pym/portage/tests/resolver/test_blocker.py
Testing with Python 2.7...
Skip Python 3.3...
Testing with Python 3.4...
Skip Python pypy...
Skip Python 3.5...
Summary:
| Version | Status
|--------------------
| 2.7 | PASS
| 3.4 | PASS
Signed-off-by: Sergei Trofimovich <siarheit@google.com>
---
runtests | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/runtests b/runtests
index d492bc8..9135768 100755
--- a/runtests
+++ b/runtests
@@ -42,7 +42,7 @@ class Colors(object):
_COLORS_YES = ('y', 'yes', 'true')
_COLORS_NO = ('n', 'no', 'false')
- GOOD = BAD = NORMAL = ''
+ WARN = GOOD = BAD = NORMAL = ''
def __init__(self, colorize=None):
if colorize is None:
@@ -63,6 +63,7 @@ class Colors(object):
raise ValueError('--colors is invalid: %s' % colorize)
if colorize:
+ self.WARN = '\033[1;33m'
self.GOOD = '\033[1;32m'
self.BAD = '\033[1;31m'
self.NORMAL = '\033[0m'
@@ -135,11 +136,14 @@ def main(argv):
if os.access(prog, os.X_OK):
print('%sTesting with Python %s...%s' %
(colors.GOOD, ver, colors.NORMAL))
- statuses.append(subprocess.call(cmd))
+ statuses.append((ver, subprocess.call(cmd)))
elif not ignore_missing:
print('%sCould not find requested Python %s%s' %
(colors.BAD, ver, colors.NORMAL))
- statuses.append(1)
+ statuses.append((ver, 1))
+ else:
+ print('%sSkip Python %s...%s' %
+ (colors.WARN, ver, colors.NORMAL))
print()
finally:
if tempdir is not None:
@@ -154,7 +158,9 @@ def main(argv):
width = 10
header = '| %-*s | %s' % (width, 'Version', 'Status')
print('%s\n|%s' % (header, '-' * (len(header) - 1)))
- for ver, status in zip(pyversions, statuses):
+ exit_status = 0
+ for ver, status in statuses:
+ exit_status += status
if status:
color = colors.BAD
msg = 'FAIL'
@@ -163,7 +169,7 @@ def main(argv):
msg = 'PASS'
print('| %s%-*s%s | %s%s%s' %
(color, width, ver, colors.NORMAL, color, msg, colors.NORMAL))
- exit(sum(statuses))
+ exit(exit_status)
if __name__ == '__main__':
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [gentoo-portage-dev] [PATCH 2/2] runtests: fix output for skipped pythons
2016-03-19 21:29 [gentoo-portage-dev] [PATCH 2/2] runtests: fix output for skipped pythons Sergei Trofimovich
@ 2016-03-20 13:53 ` Alexander Berntsen
2016-03-24 22:33 ` Sergei Trofimovich
2016-03-29 10:12 ` Alexander Berntsen
1 sibling, 1 reply; 4+ messages in thread
From: Alexander Berntsen @ 2016-03-20 13:53 UTC (permalink / raw
To: gentoo-portage-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Replying to this email segfaulted my Thunderbird... I'll try this again:
Nice! This LGMT too, and I'll commit and push it Monday with the other
one unless there are any objections.
However, Sergei, when you're sending related patches, please send them
to the same thread. git send-email should do this by default. Buuuut
these patches *aren't* related, so there shouldn't be a counter there
in the first place. ;)
Thanks for the patches!
- --
Alexander
bernalex@gentoo.org
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCgAGBQJW7qs9AAoJENQqWdRUGk8BDoMQAIhrlsY14r/B8Otbhgzbhh9T
Jol7FqInCZ/BPKmBJPhlSQiFB9SESSavxUYAVGYS/8xOjWnwU4aiiwHfmszrOD+Y
9ZgMly6mqefNsxSfBiurd8BuSFMm8l9bSkXmZyPTwAi2qsGt+j0QFlQg/6A4uLQ9
bem9tZzxvxmSLADhmdT9h2ONV9sjJq3gzzJ9+Ri5hcDByiwBXcqWNvh/IuayVE5y
cC5CwnwZ/axuiOJQJwLMKCgTC3kLlZm+8x7D1mBS8J0RErVFj8ieoJtqHsLlR35d
RuW1dwWfTiXkL/Mh0j6VVqXnqlTGRMMWexk7C4JQo2ecN065jv6xs3ZBtmhdPKAQ
cP5QMEyjr2talIMRxkPGp1msFuQu5CnR540iC5Ic0ePk9KJt0RNmna9+Zc/r//vr
OoFCFmDtvU5Kf43EW/DlHy4yLpe8wyh7UHEm2h+sVedf/jh6gEb8XUVsSohiUveJ
u4X8xhMzQnuOa1FIuuLbxecYUxReEcAJgdD/2ahYnQDPrwo+1GOH+zjSCv9UeNW2
dVCV5d774YcRJ1sVtqBugx4OV7dveTXbknBjp/cXkTq04Na7HWjpIve+8tA37B04
aqRlnlXi8G1OM8sLUjYRt9ogQ/eR6hldEq50iW8ROW8QSU58h6Qjk5JCEVuXb0m6
5ahuJEGflOU9fCrpgVdX
=s0Zw
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-portage-dev] [PATCH 2/2] runtests: fix output for skipped pythons
2016-03-20 13:53 ` Alexander Berntsen
@ 2016-03-24 22:33 ` Sergei Trofimovich
0 siblings, 0 replies; 4+ messages in thread
From: Sergei Trofimovich @ 2016-03-24 22:33 UTC (permalink / raw
To: Alexander Berntsen; +Cc: gentoo-portage-dev
[-- Attachment #1: Type: text/plain, Size: 233 bytes --]
On Sun, 20 Mar 2016 14:53:01 +0100
Alexander Berntsen <bernalex@gentoo.org> wrote:
> Nice! This LGMT too, and I'll commit and push it Monday with the other
> one unless there are any objections.
Thanks :)
--
Sergei
[-- Attachment #2: Цифровая подпись OpenPGP --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-portage-dev] [PATCH 2/2] runtests: fix output for skipped pythons
2016-03-19 21:29 [gentoo-portage-dev] [PATCH 2/2] runtests: fix output for skipped pythons Sergei Trofimovich
2016-03-20 13:53 ` Alexander Berntsen
@ 2016-03-29 10:12 ` Alexander Berntsen
1 sibling, 0 replies; 4+ messages in thread
From: Alexander Berntsen @ 2016-03-29 10:12 UTC (permalink / raw
To: gentoo-portage-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Pushed as aa7558a93d42d73ad916eecd2c3e8c6c294fe735.
- --
Alexander
bernalex@gentoo.org
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCgAGBQJW+lUCAAoJENQqWdRUGk8BiekQAMy3U5kBVEJozLInUenb9Saz
8Pv/Sopr0OC78epmWT4Dh2d+iRtTfihD11LrqcXD53RJRAyC5QqpT5M+MLXqIDUf
pzlX863Qerjm56fUpxk6SREAXg2B73AdPY6xatKLtWMjrupoXThq1olbGYOEECgZ
RjdNiNNiPDIKDj+0ZWPBnD5E/H52rdZ2GYrGY9Uf0xuNS11r8F2FUULkXl1AYEPT
oTzISATwcm52VdH1A/u/+6XORu3NdO61SaAlXPl8AJGXhcXTdfCX3BY6vav1o32f
jEv28+r5Fro6pmQRYIlT1CauaGKU/YgVoKEzvoXTX5XOIqBrgCbE/DW4b8ofr+hP
txFDSCKEdA7gAKdW/twLB2axSLCUXPJlQn+RytOtC6gZx/Su5dBq8loXasuxFZ/J
4dzcYVHAjnYb5ww7rfjyf9wc+RQj3dncGM1EKCe8X8cN+v3DXY+FHCyulz3E5hLK
waDu9zc30QHt0igJjz9m81KxWy0jKOn9GnI9S8vVjOTY7JDIsUakaClB6zugbBiD
sS4dY+MYacd2vVLy9hx5rV8s+w8eFiLCxRC+bZbVH8uLybwiBa/ShD4hs33sITuL
Sg4bqCxXxfpGu8frGOEWW1MS9Eqog6et9OyLg8RSxx+WAb8JG5b5yXgoRnnAiSgO
35aEiTYjGSBhgxic6HPx
=Id//
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-03-29 10:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-19 21:29 [gentoo-portage-dev] [PATCH 2/2] runtests: fix output for skipped pythons Sergei Trofimovich
2016-03-20 13:53 ` Alexander Berntsen
2016-03-24 22:33 ` Sergei Trofimovich
2016-03-29 10:12 ` Alexander Berntsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox