public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/, pmstestsuite/output/
Date: Fri,  5 Aug 2011 17:09:27 +0000 (UTC)	[thread overview]
Message-ID: <b005815aa751b9954249966ec1e1fed5dd16d40f.mgorny@gentoo> (raw)

commit:     b005815aa751b9954249966ec1e1fed5dd16d40f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  5 17:10:34 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Aug  5 17:10:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=b005815a

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()
 
 	def all_done(self):
-		ret = True
-		for pm, res in self.results.items():
-			ret &= self.output(res, verbose = self.verbose)
+		ret = self.output(self.results, verbose = self.verbose)
 
 		self.ret = 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.
 
 		@param results: test result dict
-		@type results: dict(L{TestCase} -> L{TestResult})
+		@type results: dict(L{PackageManager} -> dict(L{TestCase} -> L{TestResult}))
 		@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 = 'cli'
 
-	def __call__(self, results, verbose = False):
-		failed = 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 = 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 = False):
+		ret = True
+		for pm, results in allresults.items():
+			failed = 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 = 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 &= bool(failed)
 
-		return bool(failed)
+		return ret



             reply	other threads:[~2011-08-05 17:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-05 17:09 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-08-05 19:54 [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/, pmstestsuite/output/ Michał Górny
2012-01-03 17:50 Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b005815aa751b9954249966ec1e1fed5dd16d40f.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox