From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QpNuA-0003BP-Uc for garchives@archives.gentoo.org; Fri, 05 Aug 2011 17:09:51 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0A67621C1E6; Fri, 5 Aug 2011 17:09:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id BFB7321C1E6 for ; Fri, 5 Aug 2011 17:09:28 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6CC891B402F for ; Fri, 5 Aug 2011 17:09:28 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id CC6528004C for ; Fri, 5 Aug 2011 17:09:27 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: Subject: [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/, pmstestsuite/output/ X-VCS-Repository: proj/pms-test-suite X-VCS-Files: pmstestsuite/cli.py pmstestsuite/output/__init__.py pmstestsuite/output/cli.py X-VCS-Directories: pmstestsuite/ pmstestsuite/output/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: b005815aa751b9954249966ec1e1fed5dd16d40f Date: Fri, 5 Aug 2011 17:09:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 631c356f42a9b2205513b748e0460679 commit: b005815aa751b9954249966ec1e1fed5dd16d40f Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Fri Aug 5 17:10:34 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Fri Aug 5 17:10:34 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3Db005815a Pass all test results to the output module. --- pmstestsuite/cli.py | 4 +--- pmstestsuite/output/__init__.py | 2 +- pmstestsuite/output/cli.py | 34 +++++++++++++++++++--------------= - 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/pmstestsuite/cli.py b/pmstestsuite/cli.py index 7f7bb48..f315b47 100644 --- a/pmstestsuite/cli.py +++ b/pmstestsuite/cli.py @@ -190,9 +190,7 @@ class PMSTestSuiteCLI(object): self.prepare() =20 def all_done(self): - ret =3D True - for pm, res in self.results.items(): - ret &=3D self.output(res, verbose =3D self.verbose) + ret =3D self.output(self.results, verbose =3D self.verbose) =20 self.ret =3D 0 if ret else 1 self.loop.quit() diff --git a/pmstestsuite/output/__init__.py b/pmstestsuite/output/__init= __.py index e57aad9..5cdb23e 100644 --- a/pmstestsuite/output/__init__.py +++ b/pmstestsuite/output/__init__.py @@ -63,7 +63,7 @@ class OutputModule(ABCObject): Output the test results. =20 @param results: test result dict - @type results: dict(L{TestCase} -> L{TestResult}) + @type results: dict(L{PackageManager} -> dict(L{TestCase} -> L{TestRes= ult})) @param verbose: whether to output the results verbosely @type verbose: bool @return: whether all of the tests succeeded diff --git a/pmstestsuite/output/cli.py b/pmstestsuite/output/cli.py index 3d0217f..9c664ab 100644 --- a/pmstestsuite/output/cli.py +++ b/pmstestsuite/output/cli.py @@ -7,19 +7,23 @@ from pmstestsuite.output import OutputModule class CLIOutput(OutputModule): name =3D 'cli' =20 - def __call__(self, results, verbose =3D False): - failed =3D filter(lambda tr: not tr[1], results.items()) - if not failed and not verbose: - print('%d tests completed successfully.' % len(results)) - else: - print('%d of %d tests completed successfully, %d failed:' - % (len(results) - len(failed), - len(results), len(failed))) - tl =3D failed if not verbose else results.items() - for t, r in tl: - print('- %s [%s]' % (t, 'OK' if r else 'FAILED')) - for a in r.assertions: - print('-> %s: %s [%s]' % (a.name, str(a), - 'OK' if a else 'FAILED')) + def __call__(self, allresults, verbose =3D False): + ret =3D True + for pm, results in allresults.items(): + failed =3D filter(lambda tr: not tr[1], results.items()) + if not failed and not verbose: + print('[%s] %d tests completed successfully.' + % (pm.name, len(results))) + else: + print('[%s] %d of %d tests completed successfully, %d failed:' + % (pm.name, len(results) - len(failed), + len(results), len(failed))) + tl =3D failed if not verbose else results.items() + for t, r in tl: + print('- %s [%s]' % (t, 'OK' if r else 'FAILED')) + for a in r.assertions: + print('-> %s: %s [%s]' % (a.name, str(a), + 'OK' if a else 'FAILED')) + ret &=3D bool(failed) =20 - return bool(failed) + return ret