Gentoo Archives: gentoo-portage-dev

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

Replies