1 |
commit: e5dec8e4157d2e913676b52563bda99ad25b9ed2 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jun 1 12:29:05 2011 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jun 1 12:29:05 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=e5dec8e4 |
7 |
|
8 |
Write the pms-test.eclass as well. |
9 |
|
10 |
--- |
11 |
PMSTestSuite/cli.py | 2 + |
12 |
PMSTestSuite/repository/pms_eclass.py | 46 +++++++++++++++++++++++++++++++++ |
13 |
2 files changed, 48 insertions(+), 0 deletions(-) |
14 |
|
15 |
diff --git a/PMSTestSuite/cli.py b/PMSTestSuite/cli.py |
16 |
index f6b56ab..8989ddb 100644 |
17 |
--- a/PMSTestSuite/cli.py |
18 |
+++ b/PMSTestSuite/cli.py |
19 |
@@ -10,6 +10,7 @@ from optparse import OptionParser |
20 |
from PMSTestSuite import PV |
21 |
from PMSTestSuite.library import load_library |
22 |
from PMSTestSuite.repository import NewEbuildRepository |
23 |
+from PMSTestSuite.repository.pms_eclass import get_common_eclass_files |
24 |
from PMSTestSuite.pm import get_package_managers |
25 |
|
26 |
class PMSTestSuiteCLI(object): |
27 |
@@ -116,6 +117,7 @@ class PMSTestSuiteCLI(object): |
28 |
files = {} |
29 |
for t in self.test_library: |
30 |
files.update(t.get_output_files()) |
31 |
+ files.update(get_common_eclass_files()) |
32 |
|
33 |
self.repository.write_files(files) |
34 |
self.repository.remanifest(files, self.pm) |
35 |
|
36 |
diff --git a/PMSTestSuite/repository/pms_eclass.py b/PMSTestSuite/repository/pms_eclass.py |
37 |
new file mode 100644 |
38 |
index 0000000..21f1ac3 |
39 |
--- /dev/null |
40 |
+++ b/PMSTestSuite/repository/pms_eclass.py |
41 |
@@ -0,0 +1,46 @@ |
42 |
+# vim:fileencoding=utf-8 |
43 |
+# (c) 2011 Michał Górny <mgorny@g.o> |
44 |
+# Released under the terms of the 2-clause BSD license. |
45 |
+ |
46 |
+import os.path |
47 |
+ |
48 |
+eclass_contents = """# Copyright 1999-2011 Gentoo Foundation |
49 |
+# Distributed under the terms of the GNU General Public License v2 |
50 |
+# $Header: $ |
51 |
+ |
52 |
+HOMEPAGE="http://www.gentoo.org/proj/en/qa/pms/pms-test-suite.xml" |
53 |
+SRC_URI="" |
54 |
+ |
55 |
+LICENSE="as-is" |
56 |
+SLOT=${EAPI-0} |
57 |
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86" |
58 |
+IUSE="" |
59 |
+ |
60 |
+DEPEND="sys-apps/dbus" |
61 |
+ |
62 |
+S=${WORKDIR} |
63 |
+ |
64 |
+EXPORT_FUNCTIONS pkg_setup |
65 |
+ |
66 |
+pms-test_pkg_setup() { |
67 |
+ : |
68 |
+} |
69 |
+ |
70 |
+pms-test_append_result() { |
71 |
+ PMS_TEST_DBUS_P=${P//-/_} |
72 |
+ dbus-send \\ |
73 |
+ --system \\ |
74 |
+ --print-reply \\ |
75 |
+ --type=method_call \\ |
76 |
+ --dest=org.gentoo.PMSTestSuite \\ |
77 |
+ /org/gentoo/PMSTestSuite/${PMS_TEST_DBUS_P} \\ |
78 |
+ org.gentoo.PMSTestSuite.append_output \\ |
79 |
+ string:"${*}" \\ |
80 |
+ || die 'Failed to append the test result using dbus' |
81 |
+}""" |
82 |
+ |
83 |
+def get_common_eclass_files(): |
84 |
+ """ Return a EbuildRepository.write_files()-dict for the eclass. """ |
85 |
+ return { |
86 |
+ os.path.join('eclass', 'pms-test.eclass'): eclass_contents |
87 |
+ } |