# Copyright 2010-2014 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 SlotCollisionTestCase(TestCase): def testSlotCollision(self): ebuilds = { "dev-libs/A-1": { "PDEPEND": "foo? ( dev-libs/B )", "IUSE": "foo" }, "dev-libs/B-1": { "IUSE": "foo" }, "dev-libs/C-1": { "DEPEND": "dev-libs/A[foo]", "EAPI": 2 }, "dev-libs/D-1": { "DEPEND": "dev-libs/A[foo=] dev-libs/B[foo=]", "IUSE": "foo", "EAPI": 2 }, "dev-libs/E-1": { }, "dev-libs/E-2": { "IUSE": "foo" }, "app-misc/Z-1": { }, "app-misc/Z-2": { }, "app-misc/Y-1": { "DEPEND": "=app-misc/Z-1" }, "app-misc/Y-2": { "DEPEND": ">app-misc/Z-1" }, "app-misc/X-1": { "DEPEND": "=app-misc/Z-2" }, "app-misc/X-2": { "DEPEND": "=dev-libs/X-2" }, } test_cases = ( ResolverPlaygroundTestCase( ["dev-libs/A", "dev-libs/B"], all_permutations = True, success = True, ignore_mergelist_order = True, mergelist = ["dev-libs/X-1", "dev-libs/A-1", "dev-libs/B-1"]), ) playground = ResolverPlayground(ebuilds=ebuilds, 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()