1 |
commit: c504e86151851db2d577839831a876e2bccf6d78 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 27 16:51:12 2011 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 27 16:51:32 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=c504e861 |
7 |
|
8 |
Add a test for DEFINED_PHASES due to eclass inherit. |
9 |
|
10 |
--- |
11 |
pmstestsuite/library/standard/__init__.py | 1 + |
12 |
pmstestsuite/library/standard/eclass_metadata.py | 27 ++++++++++++++++++++++ |
13 |
2 files changed, 28 insertions(+), 0 deletions(-) |
14 |
|
15 |
diff --git a/pmstestsuite/library/standard/__init__.py b/pmstestsuite/library/standard/__init__.py |
16 |
index e90726c..23a66a6 100644 |
17 |
--- a/pmstestsuite/library/standard/__init__.py |
18 |
+++ b/pmstestsuite/library/standard/__init__.py |
19 |
@@ -26,6 +26,7 @@ class StandardTestLibrary(TestLibrary): |
20 |
'eclass_depend.RDependInheritanceTest', |
21 |
'eclass_depend.PDependInheritanceTest', |
22 |
'eclass_metadata.IUseInheritanceTest', |
23 |
+ 'eclass_metadata.EclassDefinedPhasesTest', |
24 |
'special_vars.InheritedVariableTest', |
25 |
'special_vars.RDependFallbackTest', |
26 |
'special_vars.DefinedPhasesTest', |
27 |
|
28 |
diff --git a/pmstestsuite/library/standard/eclass_metadata.py b/pmstestsuite/library/standard/eclass_metadata.py |
29 |
index ea15a38..4e5ed15 100644 |
30 |
--- a/pmstestsuite/library/standard/eclass_metadata.py |
31 |
+++ b/pmstestsuite/library/standard/eclass_metadata.py |
32 |
@@ -49,3 +49,30 @@ class IUseInheritanceTest(VariableInheritanceTest): |
33 |
and self.var_ebuild_value in spl |
34 |
|
35 |
# XXX: REQUIRED_USE |
36 |
+ |
37 |
+class EclassDefinedPhasesTest(DBusEclassTestCase): |
38 |
+ """ Check whether eclasses set DEFINED_PHASES as well. """ |
39 |
+ |
40 |
+ supported_eapis = (4,) |
41 |
+ phase_funcs = { |
42 |
+ 'pkg_setup': [ |
43 |
+ ':' |
44 |
+ ] |
45 |
+ } |
46 |
+ |
47 |
+ @property |
48 |
+ def eclass_contents(self): |
49 |
+ return ''' |
50 |
+EXPORT_FUNCTIONS src_compile |
51 |
+ |
52 |
+%s_src_compile() { |
53 |
+ : |
54 |
+} |
55 |
+''' % self.pn |
56 |
+ |
57 |
+ def check_dbus_result(self, output, pm): |
58 |
+ if not DBusEclassTestCase.check_dbus_result(self, output, pm): |
59 |
+ return False |
60 |
+ |
61 |
+ phases = pm.installed[self.atom(pm)].defined_phases |
62 |
+ return (sorted(phases) == ['compile', 'setup']) |