aboutsummaryrefslogtreecommitdiff
blob: ce614a4dc9aca5ddf52243418e80fd14fffc0bee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Copyright 2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

from portage.tests import TestCase
from portage.tests.resolver.ResolverPlayground import (
	ResolverPlayground,
	ResolverPlaygroundTestCase,
)

class SlotOperatorReverseDepsTestCase(TestCase):

	def testSlotOperatorReverseDeps(self):

		ebuilds = {

			"media-libs/mesa-11.2.2" : {
				"EAPI": "6",
				"SLOT": "0",
				"RDEPEND": ">=sys-devel/llvm-3.6.0:="
			},

			"sys-devel/clang-3.7.1-r100" : {
				"EAPI": "6",
				"SLOT": "0/3.7",
				"RDEPEND": "~sys-devel/llvm-3.7.1"
			},

			"sys-devel/clang-3.8.0-r100" : {
				"EAPI": "6",
				"SLOT": "0/3.8",
				"RDEPEND": "~sys-devel/llvm-3.8.0"
			},

			"sys-devel/llvm-3.7.1-r2" : {
				"EAPI": "6",
				"SLOT": "0/3.7.1",
				"PDEPEND": "=sys-devel/clang-3.7.1-r100"
			},

			"sys-devel/llvm-3.8.0-r2" : {
				"EAPI": "6",
				"SLOT": "0/3.8.0",
				"PDEPEND": "=sys-devel/clang-3.8.0-r100"
			},

		}

		installed = {

			"media-libs/mesa-11.2.2" : {
				"EAPI": "6",
				"SLOT": "0",
				"RDEPEND": ">=sys-devel/llvm-3.6.0:0/3.7.1="
			},

			"sys-devel/clang-3.7.1-r100" : {
				"EAPI": "6",
				"SLOT": "0/3.7",
				"RDEPEND": "~sys-devel/llvm-3.7.1"
			},

			"sys-devel/llvm-3.7.1-r2" : {
				"EAPI": "6",
				"SLOT": "0/3.7.1",
				"PDEPEND": "=sys-devel/clang-3.7.1-r100"
			},

		}

		world = ["media-libs/mesa"]

		test_cases = (

			# Test bug #584626, where an llvm update is missed due to
			# the check_reverse_dependencies function seeing that
			# updating llvm will break a dependency of the installed
			# version of clang (though a clang update is available).
			ResolverPlaygroundTestCase(
				["@world"],
				options = {"--update": True, "--deep": True},
				success = True,
				mergelist = [
					'sys-devel/llvm-3.8.0-r2',
					'sys-devel/clang-3.8.0-r100',
					'media-libs/mesa-11.2.2',
				],
			),

			ResolverPlaygroundTestCase(
				["@world"],
				options = {
					"--update": True,
					"--deep": True,
					"--ignore-built-slot-operator-deps": "y",
				},
				success = True,
				mergelist = [
					'sys-devel/llvm-3.8.0-r2',
					'sys-devel/clang-3.8.0-r100',
				],
			),

		)

		playground = ResolverPlayground(ebuilds=ebuilds,
			installed=installed, world=world, debug=False)
		try:
			for test_case in test_cases:
				playground.run_TestCase(test_case)
				self.assertEqual(test_case.test_success, True,
					test_case.fail_msg)
		finally:
			playground.cleanup()