Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/library/standard/
Date: Wed, 29 Jun 2011 12:58:16
Message-Id: 6f30312d03eed2ac0317bbf0afab11b9f6d9313d.mgorny@gentoo
1 commit: 6f30312d03eed2ac0317bbf0afab11b9f6d9313d
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 29 12:25:54 2011 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 29 12:25:54 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=6f30312d
7
8 Add a common DBusFetchingEbuildTestCase.
9
10 ---
11 pmstestsuite/library/standard/deprecated_vars.py | 12 ++++++++----
12 pmstestsuite/library/standard/ext_cases.py | 19 +++++++++++++++++++
13 pmstestsuite/library/standard/workdir_fallback.py | 7 +++----
14 3 files changed, 30 insertions(+), 8 deletions(-)
15
16 diff --git a/pmstestsuite/library/standard/deprecated_vars.py b/pmstestsuite/library/standard/deprecated_vars.py
17 index c4c72a3..fce66f9 100644
18 --- a/pmstestsuite/library/standard/deprecated_vars.py
19 +++ b/pmstestsuite/library/standard/deprecated_vars.py
20 @@ -3,15 +3,14 @@
21 # Released under the terms of the 2-clause BSD license.
22
23 from pmstestsuite.library.standard.dbus_case import DBusEbuildTestCase
24 +from pmstestsuite.library.standard.ext_cases import DBusFetchingEbuildTestCase
25
26 -class AATest(DBusEbuildTestCase):
27 +class AATest(DBusFetchingEbuildTestCase):
28 """ Test whether AA is declared. """
29
30 relevant_eapis = (3, 4)
31 ebuild_vars = {
32 - 'IUSE': 'pms_tests_magical_hidden_use', # XXX?
33 - 'SRC_URI': '''pms_tests_magical_hidden_use? (
34 - http://www.gentoo.org/ -> pms-test-suite-dummy.html )'''
35 + 'IUSE': 'pms_tests_magical_hidden_use' # XXX?
36 }
37 phase_funcs = {
38 'src_unpack': [
39 @@ -19,6 +18,11 @@ class AATest(DBusEbuildTestCase):
40 ]
41 }
42
43 + def __init__(self, *args, **kwargs):
44 + DBusFetchingEbuildTestCase.__init__(self, *args, **kwargs)
45 + self.ebuild_vars['SRC_URI'] = 'pms_tests_magical_hidden_use? ( %s )' \
46 + % self.ebuild_vars['SRC_URI']
47 +
48 def check_dbus_result(self, output, pm):
49 if self.eapi < 4:
50 expect = 'pms-test-suite-dummy.html'
51
52 diff --git a/pmstestsuite/library/standard/ext_cases.py b/pmstestsuite/library/standard/ext_cases.py
53 new file mode 100644
54 index 0000000..d1d5eb6
55 --- /dev/null
56 +++ b/pmstestsuite/library/standard/ext_cases.py
57 @@ -0,0 +1,19 @@
58 +# vim:fileencoding=utf-8
59 +# (c) 2011 Michał Górny <mgorny@g.o>
60 +# Released under the terms of the 2-clause BSD license.
61 +
62 +from pmstestsuite.library.standard.dbus_case import DBusEbuildTestCase
63 +
64 +class DBusFetchingEbuildTestCase(DBusEbuildTestCase):
65 + """
66 + A DBusEbuildTestCase variant with a standarized way of fetching
67 + sources -- to decrease ${DISTDIR} pollution.
68 + """
69 +
70 + def __init__(self, *args, **kwargs):
71 + DBusEbuildTestCase.__init__(self, *args, **kwargs)
72 + # XXX: switch to a dedicated file without the arrow
73 + val = 'http://www.gentoo.org/ -> pms-test-suite-dummy.html'
74 + if 'SRC_URI' in self.ebuild_vars:
75 + val = '%s %s' % (self.ebuild_vars['SRC_URI'], val)
76 + self.ebuild_vars['SRC_URI'] = val
77
78 diff --git a/pmstestsuite/library/standard/workdir_fallback.py b/pmstestsuite/library/standard/workdir_fallback.py
79 index 142c33c..96cd2e8 100644
80 --- a/pmstestsuite/library/standard/workdir_fallback.py
81 +++ b/pmstestsuite/library/standard/workdir_fallback.py
82 @@ -2,9 +2,9 @@
83 # (c) 2011 Michał Górny <mgorny@g.o>
84 # Released under the terms of the 2-clause BSD license.
85
86 -from pmstestsuite.library.standard.dbus_case import DBusEbuildTestCase
87 +from pmstestsuite.library.standard.ext_cases import DBusFetchingEbuildTestCase
88
89 -class WorkdirFallbackTest(DBusEbuildTestCase):
90 +class WorkdirFallbackTest(DBusFetchingEbuildTestCase):
91 """ S=${WORKDIR} fallback test. """
92
93 relevant_eapis = (2, 4)
94 @@ -15,7 +15,6 @@ class WorkdirFallbackTest(DBusEbuildTestCase):
95 # 3) have one of the further phase funcs.
96
97 ebuild_vars = {
98 - 'SRC_URI': 'http://www.gentoo.org/ -> pms-test-suite-dummy.html',
99 'S': '${WORKDIR}/nonexistent'
100 }
101 phase_funcs = {
102 @@ -28,5 +27,5 @@ class WorkdirFallbackTest(DBusEbuildTestCase):
103 }
104
105 def __init__(self, *args, **kwargs):
106 - DBusEbuildTestCase.__init__(self, *args, **kwargs)
107 + DBusFetchingEbuildTestCase.__init__(self, *args, **kwargs)
108 self.expect_failure = (self.eapi == 4)