1 |
commit: ac6f924fa3d9296778d493a16a1d428ab54dda97 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jun 23 06:17:17 2016 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jun 26 23:49:29 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ac6f924f |
7 |
|
8 |
Add a unit test which reproduces bug 584626 |
9 |
|
10 |
X-Gentoo-Bug: 584626 |
11 |
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=584626 |
12 |
|
13 |
.../resolver/test_slot_operator_reverse_deps.py | 109 +++++++++++++++++++++ |
14 |
1 file changed, 109 insertions(+) |
15 |
|
16 |
diff --git a/pym/portage/tests/resolver/test_slot_operator_reverse_deps.py b/pym/portage/tests/resolver/test_slot_operator_reverse_deps.py |
17 |
new file mode 100644 |
18 |
index 0000000..72879f8 |
19 |
--- /dev/null |
20 |
+++ b/pym/portage/tests/resolver/test_slot_operator_reverse_deps.py |
21 |
@@ -0,0 +1,109 @@ |
22 |
+# Copyright 2016 Gentoo Foundation |
23 |
+# Distributed under the terms of the GNU General Public License v2 |
24 |
+ |
25 |
+from portage.tests import TestCase |
26 |
+from portage.tests.resolver.ResolverPlayground import ( |
27 |
+ ResolverPlayground, |
28 |
+ ResolverPlaygroundTestCase, |
29 |
+) |
30 |
+ |
31 |
+class SlotOperatorReverseDepsTestCase(TestCase): |
32 |
+ |
33 |
+ def testSlotOperatorReverseDeps(self): |
34 |
+ |
35 |
+ ebuilds = { |
36 |
+ |
37 |
+ "media-libs/mesa-11.2.2" : { |
38 |
+ "EAPI": "6", |
39 |
+ "SLOT": "0", |
40 |
+ "RDEPEND": ">=sys-devel/llvm-3.6.0:=" |
41 |
+ }, |
42 |
+ |
43 |
+ "sys-devel/clang-3.7.1-r100" : { |
44 |
+ "EAPI": "6", |
45 |
+ "SLOT": "0/3.7", |
46 |
+ "RDEPEND": "~sys-devel/llvm-3.7.1" |
47 |
+ }, |
48 |
+ |
49 |
+ "sys-devel/clang-3.8.0-r100" : { |
50 |
+ "EAPI": "6", |
51 |
+ "SLOT": "0/3.8", |
52 |
+ "RDEPEND": "~sys-devel/llvm-3.8.0" |
53 |
+ }, |
54 |
+ |
55 |
+ "sys-devel/llvm-3.7.1-r2" : { |
56 |
+ "EAPI": "6", |
57 |
+ "SLOT": "0/3.7.1", |
58 |
+ "PDEPEND": "=sys-devel/clang-3.7.1-r100" |
59 |
+ }, |
60 |
+ |
61 |
+ "sys-devel/llvm-3.8.0-r2" : { |
62 |
+ "EAPI": "6", |
63 |
+ "SLOT": "0/3.8.0", |
64 |
+ "PDEPEND": "=sys-devel/clang-3.8.0-r100" |
65 |
+ }, |
66 |
+ |
67 |
+ } |
68 |
+ |
69 |
+ installed = { |
70 |
+ |
71 |
+ "media-libs/mesa-11.2.2" : { |
72 |
+ "EAPI": "6", |
73 |
+ "SLOT": "0", |
74 |
+ "RDEPEND": ">=sys-devel/llvm-3.6.0:0/3.7.1=" |
75 |
+ }, |
76 |
+ |
77 |
+ "sys-devel/clang-3.7.1-r100" : { |
78 |
+ "EAPI": "6", |
79 |
+ "SLOT": "0/3.7", |
80 |
+ "RDEPEND": "~sys-devel/llvm-3.7.1" |
81 |
+ }, |
82 |
+ |
83 |
+ "sys-devel/llvm-3.7.1-r2" : { |
84 |
+ "EAPI": "6", |
85 |
+ "SLOT": "0/3.7.1", |
86 |
+ "PDEPEND": "=sys-devel/clang-3.7.1-r100" |
87 |
+ }, |
88 |
+ |
89 |
+ } |
90 |
+ |
91 |
+ world = ["media-libs/mesa"] |
92 |
+ |
93 |
+ test_cases = ( |
94 |
+ |
95 |
+ # Test bug #584626, where an llvm update is missed due to |
96 |
+ # the check_reverse_dependencies function seeing that |
97 |
+ # updating llvm will break a dependency of the installed |
98 |
+ # version of clang (though a clang update is available). |
99 |
+ ResolverPlaygroundTestCase( |
100 |
+ ["@world"], |
101 |
+ options = {"--update": True, "--deep": True}, |
102 |
+ success = True, |
103 |
+ mergelist = [], |
104 |
+ ), |
105 |
+ |
106 |
+ ResolverPlaygroundTestCase( |
107 |
+ ["@world"], |
108 |
+ options = { |
109 |
+ "--update": True, |
110 |
+ "--deep": True, |
111 |
+ "--ignore-built-slot-operator-deps": "y", |
112 |
+ }, |
113 |
+ success = True, |
114 |
+ mergelist = [ |
115 |
+ 'sys-devel/llvm-3.8.0-r2', |
116 |
+ 'sys-devel/clang-3.8.0-r100', |
117 |
+ ], |
118 |
+ ), |
119 |
+ |
120 |
+ ) |
121 |
+ |
122 |
+ playground = ResolverPlayground(ebuilds=ebuilds, |
123 |
+ installed=installed, world=world, debug=False) |
124 |
+ try: |
125 |
+ for test_case in test_cases: |
126 |
+ playground.run_TestCase(test_case) |
127 |
+ self.assertEqual(test_case.test_success, True, |
128 |
+ test_case.fail_msg) |
129 |
+ finally: |
130 |
+ playground.cleanup() |