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 1QWCdH-0004Kg-Um for garchives@archives.gentoo.org; Mon, 13 Jun 2011 19:17:08 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8E6121C018; Mon, 13 Jun 2011 19:16:59 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 4E5471C018 for ; Mon, 13 Jun 2011 19:16:59 +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 4607E1B4020 for ; Mon, 13 Jun 2011 19:16:58 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id A128A8003E for ; Mon, 13 Jun 2011 19:16:57 +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: <12ec0581aba2550502c8659709aa2366127a1519.mgorny@gentoo> Subject: [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/library/standard/, PMSTestSuite/library/standard/basic/, ... X-VCS-Repository: proj/pms-test-suite X-VCS-Files: PMSTestSuite/library/depend_case.py PMSTestSuite/library/standard/__init__.py PMSTestSuite/library/standard/basic/depend.py X-VCS-Directories: PMSTestSuite/library/standard/ PMSTestSuite/library/standard/basic/ PMSTestSuite/library/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 12ec0581aba2550502c8659709aa2366127a1519 Date: Mon, 13 Jun 2011 19:16:57 +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: 5db900fe344c83ab75b9bf6141f445ca commit: 12ec0581aba2550502c8659709aa2366127a1519 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Mon Jun 13 19:04:42 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Mon Jun 13 19:04:42 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3D12ec0581 Some initial code for dependency resolution testing (incomplete). --- PMSTestSuite/library/depend_case.py | 41 +++++++++++++++++++= ++++++ PMSTestSuite/library/standard/__init__.py | 3 +- PMSTestSuite/library/standard/basic/depend.py | 20 ++++++++++++ 3 files changed, 63 insertions(+), 1 deletions(-) diff --git a/PMSTestSuite/library/depend_case.py b/PMSTestSuite/library/d= epend_case.py new file mode 100644 index 0000000..9e83f81 --- /dev/null +++ b/PMSTestSuite/library/depend_case.py @@ -0,0 +1,41 @@ +# vim:fileencoding=3Dutf-8 +# (c) 2011 Micha=C5=82 G=C3=B3rny +# Released under the terms of the 2-clause BSD license. + +from PMSTestSuite.library.case import EbuildTestCase + +class EbuildDependencyTestCase(EbuildTestCase): + """ + Test case utilizing multiple ebuilds in order to check dependency + resolution. + + In order to perform a dependency test, please: + 1) create EbuildTestCase subclasses for the dependencies like usual, + 2) create EbuildDependencyTestCase and refer to the classes created abo= ve in + depend_classes or rdepend_classes. + + The class is going to set up all ebuilds, DEPEND and RDEPEND automagica= lly. + However, you need to provide phase functions to perform the actual + dependency test (i.e. check whether the dependency was merged successfu= lly). + """ + + depend_classes =3D [] + rdepend_classes =3D [] + + def __init__(self, eapi): + EbuildTestCase.__init__(self, eapi) + + self.depend_objs =3D [] + self.rdepend_objs =3D [] + + for class_list, obj_list in ((self.depend_classes, self.depend_objs), + (self.rdepend_classes, self.rdepend_objs)): + for d in class_list: + obj_list.append(d(eapi)) + + for v, obj_list in (('DEPEND', self.depend_objs), + ('RDEPEND', self.rdepend_objs)): + if v not in self.ebuild_vars: + self.ebuild_vars[v] =3D '' + for o in obj_list: + self.ebuild_vars[v] +=3D '\n\t=3D%s' % o.cpv diff --git a/PMSTestSuite/library/standard/__init__.py b/PMSTestSuite/lib= rary/standard/__init__.py index 628d4b1..23b4895 100644 --- a/PMSTestSuite/library/standard/__init__.py +++ b/PMSTestSuite/library/standard/__init__.py @@ -14,7 +14,8 @@ class StandardTestLibrary(TestLibrary): =20 test_names=3D[ 'basic.phase_function_order.PhaseFunctionOrderTest', - 'basic.doins_fail.DoInsFailureTest' + 'basic.doins_fail.DoInsFailureTest', + 'basic.depend.DependTest' ] =20 def get_common_files(self): diff --git a/PMSTestSuite/library/standard/basic/depend.py b/PMSTestSuite= /library/standard/basic/depend.py new file mode 100644 index 0000000..2ac57ff --- /dev/null +++ b/PMSTestSuite/library/standard/basic/depend.py @@ -0,0 +1,20 @@ +# vim:fileencoding=3Dutf-8 +# (c) 2011 Micha=C5=82 G=C3=B3rny +# Released under the terms of the 2-clause BSD license. + +from PMSTestSuite.library.standard.dbus_case import DBusEbuildTestCase +from PMSTestSuite.library.depend_case import EbuildDependencyTestCase + +class EbuildToucher(DBusEbuildTestCase): + ebuild_vars =3D { + 'DESCRIPTION': 'A random dependency ebuild' + } + +class DependTest(EbuildDependencyTestCase): + relevant_eapis =3D (0,) + + ebuild_vars =3D { + 'DESCRIPTION': 'DEPEND fulfilling test' + } + + depend_classes =3D [EbuildToucher]