ResolverDepthTestCase: test new-style virtuals
authorZac Medico <zmedico@gentoo.org>
Sun, 13 Feb 2011 13:00:28 +0000 (05:00 -0800)
committerZac Medico <zmedico@gentoo.org>
Mon, 14 Feb 2011 04:29:26 +0000 (20:29 -0800)
pym/portage/tests/resolver/test_depth.py

index dc670052e8189f8941fb6ffcbfd88173052e3d7a..cecdd37e27780569efe6282e8199727f42aa13cd 100644 (file)
@@ -16,12 +16,39 @@ class ResolverDepthTestCase(TestCase):
                        "dev-libs/B-2": {"RDEPEND" : "dev-libs/C"},
                        "dev-libs/C-1": {},
                        "dev-libs/C-2": {},
+
+                       "virtual/jre-1.5.0"        : {"SLOT" : "1.5", "RDEPEND" : "|| ( =dev-java/sun-jre-bin-1.5.0* =virtual/jdk-1.5.0* )"},
+                       "virtual/jre-1.5.0-r1"     : {"SLOT" : "1.5", "RDEPEND" : "|| ( =dev-java/sun-jre-bin-1.5.0* =virtual/jdk-1.5.0* )"},
+                       "virtual/jre-1.6.0"        : {"SLOT" : "1.6", "RDEPEND" : "|| ( =dev-java/sun-jre-bin-1.6.0* =virtual/jdk-1.6.0* )"},
+                       "virtual/jre-1.6.0-r1"     : {"SLOT" : "1.6", "RDEPEND" : "|| ( =dev-java/sun-jre-bin-1.6.0* =virtual/jdk-1.6.0* )"},
+                       "virtual/jdk-1.5.0"        : {"SLOT" : "1.5", "RDEPEND" : "|| ( =dev-java/sun-jdk-1.5.0* dev-java/gcj-jdk )"},
+                       "virtual/jdk-1.5.0-r1"     : {"SLOT" : "1.5", "RDEPEND" : "|| ( =dev-java/sun-jdk-1.5.0* dev-java/gcj-jdk )"},
+                       "virtual/jdk-1.6.0"        : {"SLOT" : "1.6", "RDEPEND" : "|| ( =dev-java/icedtea-6* =dev-java/sun-jdk-1.6.0* )"},
+                       "virtual/jdk-1.6.0-r1"     : {"SLOT" : "1.6", "RDEPEND" : "|| ( =dev-java/icedtea-6* =dev-java/sun-jdk-1.6.0* )"},
+                       "dev-java/gcj-jdk-4.5"     : {},
+                       "dev-java/gcj-jdk-4.5-r1"  : {},
+                       "dev-java/icedtea-6.1"     : {},
+                       "dev-java/icedtea-6.1-r1"  : {},
+                       "dev-java/sun-jdk-1.5"     : {"SLOT" : "1.5"},
+                       "dev-java/sun-jdk-1.6"     : {"SLOT" : "1.6"},
+                       "dev-java/sun-jre-bin-1.5" : {"SLOT" : "1.5"},
+                       "dev-java/sun-jre-bin-1.6" : {"SLOT" : "1.6"},
+
+                       "dev-java/ant-core-1.8"   : {"DEPEND"  : ">=virtual/jdk-1.4"},
+                       "dev-db/hsqldb-1.8"       : {"RDEPEND" : ">=virtual/jre-1.6"},
                        }
 
                installed = {
                        "dev-libs/A-1": {"RDEPEND" : "dev-libs/B"},
                        "dev-libs/B-1": {"RDEPEND" : "dev-libs/C"},
                        "dev-libs/C-1": {},
+
+                       "virtual/jre-1.5.0"       : {"SLOT" : "1.5", "RDEPEND" : "|| ( =virtual/jdk-1.5.0* =dev-java/sun-jre-bin-1.5.0* )"},
+                       "virtual/jre-1.6.0"       : {"SLOT" : "1.6", "RDEPEND" : "|| ( =virtual/jdk-1.6.0* =dev-java/sun-jre-bin-1.6.0* )"},
+                       "virtual/jdk-1.5.0"       : {"SLOT" : "1.5", "RDEPEND" : "|| ( =dev-java/sun-jdk-1.5.0* dev-java/gcj-jdk )"},
+                       "virtual/jdk-1.6.0"       : {"SLOT" : "1.6", "RDEPEND" : "|| ( =dev-java/icedtea-6* =dev-java/sun-jdk-1.6.0* )"},
+                       "dev-java/gcj-jdk-4.5"    : {},
+                       "dev-java/icedtea-6.1"    : {},
                        }
 
                world = ["dev-libs/A"]
@@ -68,6 +95,69 @@ class ResolverDepthTestCase(TestCase):
                                options = {"--deep": 2},
                                success = True,
                                mergelist = ["dev-libs/A-2"]),
+
+                       ResolverPlaygroundTestCase(
+                               ["virtual/jre"],
+                               options = {},
+                               success = True,
+                               mergelist = ['virtual/jre-1.6.0-r1']),
+
+                       ResolverPlaygroundTestCase(
+                               ["virtual/jre"],
+                               options = {"--deep" : True},
+                               success = True,
+                               mergelist = ['virtual/jre-1.6.0-r1']),
+
+                       # Test bug #141118, where we avoid pulling in
+                       # redundant deps, satisfying nested virtuals
+                       # as efficiently as possible.
+                       ResolverPlaygroundTestCase(
+                               ["virtual/jre"],
+                               options = {"--selective" : True, "--deep" : True},
+                               success = True,
+                               mergelist = []),
+
+                       # Test bug #150361, where depgraph._greedy_slots()
+                       # is triggered by --update with AtomArg.
+                       ResolverPlaygroundTestCase(
+                               ["virtual/jre"],
+                               options = {"--update" : True},
+                               success = True,
+                               mergelist = ['dev-java/icedtea-6.1-r1', 'dev-java/gcj-jdk-4.5-r1', 'virtual/jdk-1.6.0-r1', 'virtual/jdk-1.5.0-r1', 'virtual/jre-1.6.0-r1', 'virtual/jre-1.5.0-r1']),
+
+                       ResolverPlaygroundTestCase(
+                               ["virtual/jre:1.5"],
+                               options = {"--update" : True},
+                               success = True,
+                               mergelist = ['dev-java/gcj-jdk-4.5-r1', 'virtual/jdk-1.5.0-r1', 'virtual/jre-1.5.0-r1']),
+
+                       ResolverPlaygroundTestCase(
+                               ["virtual/jre:1.6"],
+                               options = {"--update" : True},
+                               success = True,
+                               mergelist = ['dev-java/icedtea-6.1-r1', 'virtual/jdk-1.6.0-r1', 'virtual/jre-1.6.0-r1']),
+
+                       # Test that we don't pull in any unnecessary updates
+                       # when --update is not specified, even though we
+                       # specified --deep.
+                       ResolverPlaygroundTestCase(
+                               ["dev-java/ant-core"],
+                               options = {"--deep" : True},
+                               success = True,
+                               mergelist = ["dev-java/ant-core-1.8"]),
+
+                       # FIXME: pulls in unwanted updates without --deep: ['dev-java/icedtea-6.1-r1', 'virtual/jdk-1.6.0-r1', 'dev-java/ant-core-1.8']
+                       #ResolverPlaygroundTestCase(
+                       #       ["dev-java/ant-core"],
+                       #       options = {"--update" : True},
+                       #       success = True,
+                       #       mergelist = ["dev-java/ant-core-1.8"]),
+
+                       ResolverPlaygroundTestCase(
+                               ["dev-db/hsqldb"],
+                               options = {"--deep" : True},
+                               success = True,
+                               mergelist = ["dev-db/hsqldb-1.8"]),
                        )
 
                playground = ResolverPlayground(ebuilds=ebuilds, installed=installed,