summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-05-20 20:30:30 -0700
committerZac Medico <zmedico@gentoo.org>2011-05-20 20:30:30 -0700
commitcf3d92869b4e7371aed6171d1bf77fc2150bf016 (patch)
tree27b5da501857e11f8f297b8928a573159332dc38
parente2c6a1f0438701bbcbd49f69bf4549cbfed3c0cd (diff)
downloadportage-cf3d92869b4e7371aed6171d1bf77fc2150bf016.tar.gz
portage-cf3d92869b4e7371aed6171d1bf77fc2150bf016.tar.bz2
portage-cf3d92869b4e7371aed6171d1bf77fc2150bf016.zip
test_merge_order: test blocker resolution
-rw-r--r--pym/portage/tests/resolver/ResolverPlayground.py6
-rw-r--r--pym/portage/tests/resolver/test_merge_order.py23
2 files changed, 29 insertions, 0 deletions
diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 298107c06..4f42b6743 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -509,6 +509,9 @@ class ResolverPlaygroundTestCase(object):
if got:
new_got = []
for cpv in got:
+ if cpv[:1] == "!":
+ new_got.append(cpv)
+ continue
a = Atom("="+cpv, allow_repo=True)
new_got.append(a.cpv)
got = new_got
@@ -516,6 +519,9 @@ class ResolverPlaygroundTestCase(object):
new_expected = []
for obj in expected:
if isinstance(obj, basestring):
+ if obj[:1] == "!":
+ new_expected.append(obj)
+ continue
a = Atom("="+obj, allow_repo=True)
new_expected.append(a.cpv)
continue
diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index a59a67870..6c929f729 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -9,6 +9,8 @@ class MergeOrderTestCase(TestCase):
def testMergeOrder(self):
ebuilds = {
+ "app-misc/blocker-buildtime-a-1" : {},
+ "app-misc/blocker-runtime-a-1" : {},
"app-misc/circ-post-runtime-a-1": {
"PDEPEND": "app-misc/circ-post-runtime-b",
},
@@ -21,6 +23,10 @@ class MergeOrderTestCase(TestCase):
"app-misc/circ-runtime-b-1": {
"RDEPEND": "app-misc/circ-runtime-a",
},
+ "app-misc/installed-blocker-a-1" : {
+ "DEPEND" : "!app-misc/blocker-buildtime-a",
+ "RDEPEND" : "!app-misc/blocker-runtime-a",
+ },
"app-misc/some-app-a-1": {
"RDEPEND": "app-misc/circ-runtime-a app-misc/circ-runtime-b",
},
@@ -30,6 +36,10 @@ class MergeOrderTestCase(TestCase):
}
installed = {
+ "app-misc/installed-blocker-a-1" : {
+ "DEPEND" : "!app-misc/blocker-buildtime-a",
+ "RDEPEND" : "!app-misc/blocker-runtime-a",
+ }
}
test_cases = (
@@ -49,6 +59,19 @@ class MergeOrderTestCase(TestCase):
["app-misc/some-app-b"],
success = True,
mergelist = ["app-misc/circ-post-runtime-a-1", "app-misc/circ-post-runtime-b-1", "app-misc/some-app-b-1"]),
+ # installed package has buildtime-only blocker
+ # that should be ignored
+ ResolverPlaygroundTestCase(
+ ["app-misc/blocker-buildtime-a"],
+ success = True,
+ mergelist = ["app-misc/blocker-buildtime-a-1"]),
+ # installed package has runtime blocker that
+ # should cause it to be uninstalled
+ # TODO: distinguish between install/uninstall tasks in mergelist
+ ResolverPlaygroundTestCase(
+ ["app-misc/blocker-runtime-a"],
+ success = True,
+ mergelist = ["app-misc/blocker-runtime-a-1", "app-misc/installed-blocker-a-1", "!app-misc/blocker-runtime-a"]),
)
playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)