From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/library/standard/, PMSTestSuite/library/standard/basic/, ...
Date: Mon, 13 Jun 2011 19:16:57 +0000 (UTC) [thread overview]
Message-ID: <12ec0581aba2550502c8659709aa2366127a1519.mgorny@gentoo> (raw)
commit: 12ec0581aba2550502c8659709aa2366127a1519
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 13 19:04:42 2011 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jun 13 19:04:42 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=12ec0581
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/depend_case.py
new file mode 100644
index 0000000..9e83f81
--- /dev/null
+++ b/PMSTestSuite/library/depend_case.py
@@ -0,0 +1,41 @@
+# vim:fileencoding=utf-8
+# (c) 2011 Michał Górny <mgorny@gentoo.org>
+# 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 above in
+ depend_classes or rdepend_classes.
+
+ The class is going to set up all ebuilds, DEPEND and RDEPEND automagically.
+ However, you need to provide phase functions to perform the actual
+ dependency test (i.e. check whether the dependency was merged successfully).
+ """
+
+ depend_classes = []
+ rdepend_classes = []
+
+ def __init__(self, eapi):
+ EbuildTestCase.__init__(self, eapi)
+
+ self.depend_objs = []
+ self.rdepend_objs = []
+
+ 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] = ''
+ for o in obj_list:
+ self.ebuild_vars[v] += '\n\t=%s' % o.cpv
diff --git a/PMSTestSuite/library/standard/__init__.py b/PMSTestSuite/library/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):
test_names=[
'basic.phase_function_order.PhaseFunctionOrderTest',
- 'basic.doins_fail.DoInsFailureTest'
+ 'basic.doins_fail.DoInsFailureTest',
+ 'basic.depend.DependTest'
]
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=utf-8
+# (c) 2011 Michał Górny <mgorny@gentoo.org>
+# 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 = {
+ 'DESCRIPTION': 'A random dependency ebuild'
+ }
+
+class DependTest(EbuildDependencyTestCase):
+ relevant_eapis = (0,)
+
+ ebuild_vars = {
+ 'DESCRIPTION': 'DEPEND fulfilling test'
+ }
+
+ depend_classes = [EbuildToucher]
next reply other threads:[~2011-06-13 19:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-13 19:16 Michał Górny [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-06-16 19:49 [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/library/standard/, PMSTestSuite/library/standard/basic/, Michał Górny
2011-06-03 17:36 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=12ec0581aba2550502c8659709aa2366127a1519.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