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/
Date: Mon, 18 Jul 2011 06:32:10 +0000 (UTC) [thread overview]
Message-ID: <2fc16a1b6dca119ce24f4c7b3194aebb754c64c1.mgorny@gentoo> (raw)
commit: 2fc16a1b6dca119ce24f4c7b3194aebb754c64c1
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 18 06:26:31 2011 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jul 18 06:26:31 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=2fc16a1b
Add tests for eclass metadata inheritance.
---
pmstestsuite/library/standard/__init__.py | 4 +
pmstestsuite/library/standard/eclass_metadata.py | 68 ++++++++++++++++++++++
2 files changed, 72 insertions(+), 0 deletions(-)
diff --git a/pmstestsuite/library/standard/__init__.py b/pmstestsuite/library/standard/__init__.py
index 79f4082..1e13811 100644
--- a/pmstestsuite/library/standard/__init__.py
+++ b/pmstestsuite/library/standard/__init__.py
@@ -22,6 +22,10 @@ class StandardTestLibrary(TestLibrary):
'depend.FailingRDependTest',
'deprecated_vars.AATest',
'deprecated_vars.KVTest',
+ 'eclass_metadata.IUseInheritanceTest',
+ 'eclass_metadata.DependInheritanceTest',
+ 'eclass_metadata.RDependInheritanceTest',
+ 'eclass_metadata.PDependInheritanceTest',
'special_vars.InheritedVariableTest',
'special_vars.RDependFallbackTest',
'special_vars.DefinedPhasesTest',
diff --git a/pmstestsuite/library/standard/eclass_metadata.py b/pmstestsuite/library/standard/eclass_metadata.py
new file mode 100644
index 0000000..18e9f64
--- /dev/null
+++ b/pmstestsuite/library/standard/eclass_metadata.py
@@ -0,0 +1,68 @@
+# vim:fileencoding=utf-8
+# (c) 2011 Michał Górny <mgorny@gentoo.org>
+# Released under the terms of the 2-clause BSD license.
+
+from abc import abstractproperty
+
+from pmstestsuite.library.standard.dbus_case import DBusEclassTestCase
+
+class VariableInheritanceTest(DBusEclassTestCase):
+ """ Eclass variable inheritance test. """
+
+ @abstractproperty
+ def var_name(self):
+ """ Variable name to test. """
+ pass
+
+ @abstractproperty
+ def var_eclass_value(self):
+ """ Inherited value to test. """
+ pass
+
+ @abstractproperty
+ def var_ebuild_value(self):
+ """ Ebuild variable value to test. """
+ pass
+
+ @property
+ def eclass_contents(self):
+ return '%s=%s\n' % (self.var_name, repr(self.var_eclass_value))
+
+ def __init__(self, *args, **kwargs):
+ DBusEclassTestCase.__init__(self, *args, **kwargs)
+ self.ebuild_vars[self.var_name] = self.var_ebuild_value
+
+ def check_dbus_result(self, output, pm):
+ # ensure it got installed first
+ if not DBusEclassTestCase.check_dbus_result(self, output, pm):
+ return False
+
+ meta = pm.installed[self.atom(pm)].metadata
+ spl = meta[self.var_name].split()
+ return self.var_eclass_value in spl \
+ and self.var_ebuild_value in spl
+
+class IUseInheritanceTest(VariableInheritanceTest):
+ """ IUSE variable inheritance test. """
+
+ var_name = 'IUSE'
+ var_eclass_value = 'foo'
+ var_ebuild_value = 'bar'
+
+class DependInheritanceTest(VariableInheritanceTest):
+ """ DEPEND variable inheritance test. """
+
+ var_name = 'DEPEND'
+ # XXX
+ var_eclass_value = 'sys-apps/coreutils'
+ var_ebuild_value = 'sys-libs/zlib'
+
+class RDependInheritanceTest(DependInheritanceTest):
+ """ RDEPEND variable inheritance test. """
+ var_name = 'RDEPEND'
+
+class PDependInheritanceTest(DependInheritanceTest):
+ """ PDEPEND variable inheritance test. """
+ var_name = 'PDEPEND'
+
+# XXX: REQUIRED_USE
next reply other threads:[~2011-07-18 6:32 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-18 6:32 Michał Górny [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-06-20 8:01 [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/library/standard/ Michał Górny
2012-01-03 17:50 Michał Górny
2012-01-03 17:50 Michał Górny
2012-01-03 15:52 Michał Górny
2011-08-13 8:54 Michał Górny
2011-08-12 20:55 Michał Górny
2011-08-08 2:56 Michał Górny
2011-08-07 14:57 Michał Górny
2011-08-07 14:57 Michał Górny
2011-08-07 14:48 Michał Górny
2011-08-06 14:25 Michał Górny
2011-08-06 8:31 Michał Górny
2011-08-06 8:31 Michał Górny
2011-08-05 21:36 Michał Górny
2011-08-05 21:36 Michał Górny
2011-08-05 21:36 Michał Górny
2011-08-05 21:36 Michał Górny
2011-08-05 10:04 Michał Górny
2011-08-05 8:54 Michał Górny
2011-08-03 20:17 Michał Górny
2011-08-03 20:17 Michał Górny
2011-08-03 17:10 Michał Górny
2011-08-03 17:10 Michał Górny
2011-08-03 17:10 Michał Górny
2011-08-03 8:17 Michał Górny
2011-08-02 18:53 Michał Górny
2011-08-02 18:53 Michał Górny
2011-07-28 17:15 Michał Górny
2011-07-27 16:50 Michał Górny
2011-07-27 16:50 Michał Górny
2011-07-27 16:50 Michał Górny
2011-07-26 17:34 Michał Górny
2011-07-24 14:37 Michał Górny
2011-07-24 14:37 Michał Górny
2011-07-18 6:32 Michał Górny
2011-06-29 17:52 Michał Górny
2011-06-29 12:58 Michał Górny
2011-06-28 16:15 Michał Górny
2011-06-28 16:15 Michał Górny
2011-06-25 8:39 Michał Górny
2011-06-24 18:03 [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/library/standard/ Michał Górny
2011-06-24 18:03 Michał Górny
2011-06-24 18:03 Michał Górny
2011-06-23 21:14 Michał Górny
2011-06-23 21:14 Michał Górny
2011-06-23 9:51 Michał Górny
2011-06-22 19:53 Michał Górny
2011-06-22 13:32 Michał Górny
2011-06-17 14:28 Michał Górny
2011-06-17 14:28 Michał Górny
2011-06-17 14:28 Michał Górny
2011-05-31 19:18 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=2fc16a1b6dca119ce24f4c7b3194aebb754c64c1.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