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 1RD5VQ-0005Nq-NV for garchives@archives.gentoo.org; Mon, 10 Oct 2011 02:22:16 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B4C8121C066; Mon, 10 Oct 2011 02:22:09 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8767A21C066 for ; Mon, 10 Oct 2011 02:22:09 +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 D5CF71B4010 for ; Mon, 10 Oct 2011 02:22:08 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 10FCF80042 for ; Mon, 10 Oct 2011 02:22:08 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <93b7bbebd96c1cca24a53659657033d621e5c1f4.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/tests/__init__.py pym/portage/tests/runTests X-VCS-Directories: pym/portage/tests/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 93b7bbebd96c1cca24a53659657033d621e5c1f4 Date: Mon, 10 Oct 2011 02:22:08 +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: 4f5587438d743ff9e445a125d538ac56 commit: 93b7bbebd96c1cca24a53659657033d621e5c1f4 Author: Zac Medico gentoo org> AuthorDate: Mon Oct 10 02:21:54 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Oct 10 02:21:54 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D93b7bbeb tests/__init__: return int from main() --- pym/portage/tests/__init__.py | 13 ++++++++----- pym/portage/tests/runTests | 4 +--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/pym/portage/tests/__init__.py b/pym/portage/tests/__init__.p= y index fedb7e6..492ece4 100644 --- a/pym/portage/tests/__init__.py +++ b/pym/portage/tests/__init__.py @@ -34,15 +34,18 @@ def main(): testsubdir =3D os.path.basename(mydir) for name in getTestNames(mydir): print("%s/%s/%s.py" % (testdir, testsubdir, name)) - sys.exit(0) + return os.EX_OK =20 if len(args) > 1: suite.addTests(getTestFromCommandLine(args[1:], basedir)) - return TextTestRunner(verbosity=3D2).run(suite) + else: + for mydir in getTestDirs(basedir): + suite.addTests(getTests(os.path.join(basedir, mydir), basedir)) =20 - for mydir in getTestDirs(basedir): - suite.addTests(getTests(os.path.join(basedir, mydir), basedir) ) - return TextTestRunner(verbosity=3D2).run(suite) + result =3D TextTestRunner(verbosity=3D2).run(suite) + if not result.wasSuccessful(): + return 1 + return os.EX_OK =20 def my_import(name): mod =3D __import__(name) diff --git a/pym/portage/tests/runTests b/pym/portage/tests/runTests index 146f7d4..4c10087 100755 --- a/pym/portage/tests/runTests +++ b/pym/portage/tests/runTests @@ -41,6 +41,4 @@ del path =20 =20 if __name__ =3D=3D "__main__": - result =3D tests.main() - if not result.wasSuccessful(): - sys.exit(1) + sys.exit(tests.main())