Tests: Properly test the circular dep handler
authorSebastian Luther <SebastianLuther@gmx.de>
Thu, 19 Aug 2010 22:56:27 +0000 (00:56 +0200)
committerZac Medico <zmedico@gentoo.org>
Thu, 19 Aug 2010 23:13:34 +0000 (16:13 -0700)
pym/portage/tests/resolver/test_circular_dependencies.py

index 3a46140ca5c5e6f311464f1cbc78701c54f7260c..73cb95a638b64b2b03c249afa0e8769df36a39d7 100644 (file)
@@ -6,34 +6,57 @@ from portage.tests.resolver.ResolverPlayground import ResolverPlayground, Resolv
 
 class CircularDependencyTestCase(TestCase):
 
+       #TODO:
+       #       use config change by autounmask
+       #       conflict on parent's parent
+       #       difference in RDEPEND and DEPEND
+       #       is there anything else than priority buildtime and runtime?
+       #       play with use.{mask,force}
+       #       play with REQUIRED_USE
+       
+
        def testCircularDependency(self):
                ebuilds = {
-                       "dev-libs/A-1": { "DEPEND": "foo? ( =dev-libs/B-1 )", "IUSE": "+foo", "EAPI": 1 }, 
-                       "dev-libs/A-2": { "DEPEND": "=dev-libs/B-1" }, 
-                       "dev-libs/A-3": { "DEPEND": "foo? ( =dev-libs/B-2 )", "IUSE": "+foo", "EAPI": 1 }, 
-                       "dev-libs/B-1": { "DEPEND": "dev-libs/C dev-libs/D" }, 
-                       "dev-libs/B-2": { "DEPEND": "bar? ( dev-libs/C dev-libs/D )", "IUSE": "+bar", "EAPI": 1 }, 
-                       "dev-libs/C-1": { "DEPEND": "dev-libs/A" }, 
-                       "dev-libs/D-1": { "DEPEND": "dev-libs/E " }, 
-                       "dev-libs/E-1": { "DEPEND": "dev-libs/F" }, 
-                       "dev-libs/F-1": { "DEPEND": "dev-libs/B" }, 
-                       
-                       "dev-libs/Z-1": { "DEPEND": "!baz? ( dev-libs/Y )", "IUSE": "baz" }, 
+                       "dev-libs/Z-1": { "DEPEND": "foo? ( !bar? ( dev-libs/Y ) )", "IUSE": "+foo bar", "EAPI": 1 }, 
+                       "dev-libs/Z-2": { "DEPEND": "foo? ( dev-libs/Y ) !bar? ( dev-libs/Y )", "IUSE": "+foo bar", "EAPI": 1 }, 
+                       "dev-libs/Z-3": { "DEPEND": "foo? ( !bar? ( dev-libs/Y ) ) foo? ( dev-libs/Y ) !bar? ( dev-libs/Y )", "IUSE": "+foo bar", "EAPI": 1 }, 
                        "dev-libs/Y-1": { "DEPEND": "dev-libs/Z" },
+                       "dev-libs/W-1": { "DEPEND": "dev-libs/Z[foo] dev-libs/Y", "EAPI": 2 },
+                       "dev-libs/W-2": { "DEPEND": "dev-libs/Z[foo=] dev-libs/Y", "IUSE": "+foo", "EAPI": 2 },
+                       "dev-libs/W-3": { "DEPEND": "dev-libs/Z[bar] dev-libs/Y", "EAPI": 2 },
                        }
 
                test_cases = (
+                       #Simple tests
+                       ResolverPlaygroundTestCase(
+                               ["=dev-libs/Z-1"],
+                               circular_dependency_solutions = { "dev-libs/Y-1": frozenset([frozenset([("foo", False)]), frozenset([("bar", True)])])},
+                               success = False),
                        ResolverPlaygroundTestCase(
-                               ["=dev-libs/A-1"],
+                               ["=dev-libs/Z-2"],
+                               circular_dependency_solutions = { "dev-libs/Y-1": frozenset([frozenset([("foo", False), ("bar", True)])])},
                                success = False),
                        ResolverPlaygroundTestCase(
-                               ["=dev-libs/A-2"],
+                               ["=dev-libs/Z-3"],
+                               circular_dependency_solutions = { "dev-libs/Y-1": frozenset([frozenset([("foo", False), ("bar", True)])])},
                                success = False),
+
+                       #Conflict on parent
                        ResolverPlaygroundTestCase(
-                               ["=dev-libs/A-3"],
+                               ["=dev-libs/W-1"],
+                               circular_dependency_solutions = {},
                                success = False),
                        ResolverPlaygroundTestCase(
-                               ["dev-libs/Z"],
+                               ["=dev-libs/W-2"],
+                               circular_dependency_solutions = { "dev-libs/Y-1": frozenset([frozenset([("foo", False), ("bar", True)])])},
+                               success = False),
+
+                       #Conflict with autounmask
+                       ResolverPlaygroundTestCase(
+                               ["=dev-libs/W-3"],
+                               options = { "--autounmask": True },
+                               circular_dependency_solutions = { "dev-libs/Y-1": frozenset([frozenset([("foo", False)])])},
+                               use_changes = { "dev-libs/Z-3": {"bar": True}},
                                success = False),
                )