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 1QZNXz-0007vn-7r for garchives@archives.gentoo.org; Wed, 22 Jun 2011 13:32:47 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 98C731C1BC; Wed, 22 Jun 2011 13:32:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 6C5BE1C1BC for ; Wed, 22 Jun 2011 13:32:29 +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 E34671B4010 for ; Wed, 22 Jun 2011 13:32:28 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 51D628003E for ; Wed, 22 Jun 2011 13:32:28 +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/library/, PMSTestSuite/ X-VCS-Repository: proj/pms-test-suite X-VCS-Files: PMSTestSuite/cli.py PMSTestSuite/library/__init__.py X-VCS-Directories: PMSTestSuite/library/ PMSTestSuite/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: ace8247e263ceda5b7da74299e5673180a37a6f9 Date: Wed, 22 Jun 2011 13:32:28 +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: cb2b8930a29a15d7ddbb1ebd35efd6ad commit: ace8247e263ceda5b7da74299e5673180a37a6f9 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Wed Jun 22 13:32:53 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Wed Jun 22 13:32:53 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3Dace8247e Support limiting the tests to run. --- PMSTestSuite/cli.py | 9 +++++++++ PMSTestSuite/library/__init__.py | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 0 deletions(-) diff --git a/PMSTestSuite/cli.py b/PMSTestSuite/cli.py index 08caa86..342a1f2 100644 --- a/PMSTestSuite/cli.py +++ b/PMSTestSuite/cli.py @@ -54,6 +54,9 @@ class PMSTestSuiteCLI(object): help=3D'Name of the repository to store ebuilds in') opt.add_option('-R', '--repository-path', dest=3D'repo_path', help=3D'Path to the repository to store ebuilds in') + opt.add_option('-t', '--tests', dest=3D'tests', + help=3D'Limit the tests to be run (may be specified multiple times)'= , + action=3D'append', default=3D[]) =20 self.optparser =3D opt =20 @@ -102,6 +105,12 @@ class PMSTestSuiteCLI(object): =20 self.pm.package_limit =3D opts.limit_pkgs self.update_manifests =3D not opts.no_manifests + =09 + limit_tests =3D set() + for t in opts.tests: + limit_tests.update(t.split()) + if limit_tests: + self.test_library.limit_tests(limit_tests) =20 def tests_done(self): self.failed =3D [] diff --git a/PMSTestSuite/library/__init__.py b/PMSTestSuite/library/__in= it__.py index 3c7f6b1..a016a80 100644 --- a/PMSTestSuite/library/__init__.py +++ b/PMSTestSuite/library/__init__.py @@ -63,6 +63,23 @@ class TestLibrary(object): def __init__(self, modname): self.modname =3D modname =20 + def limit_tests(self, limitations): + if self.tests is not None: + raise SystemError('TestLibrary.limit_tests() must be called before in= itiating tests.') + + ls =3D [] + for l in limitations: + ls.append(l.split('.')) + + newnames =3D set() + for t in self.test_names: + ts =3D t.split('.') + for l in ls: + if ts[:len(l)] =3D=3D l: + newnames.add(t) + + self.test_names =3D newnames + def get_common_files(self): """ Return common files necessary for the library (e.g. eclasses). """ return {}