diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-07-10 15:45:12 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-07-10 15:45:12 -0700 |
commit | c42591b5d0484459837da28482f70fad9ff13824 (patch) | |
tree | 1f44082790e1e7fb0e1e2340eed0a7ef18ef0770 /pym/portage/tests/resolver | |
parent | 8639e39d6c13306661261a3cb66c6827bcd2d26c (diff) | |
download | portage-c42591b5d0484459837da28482f70fad9ff13824.tar.gz portage-c42591b5d0484459837da28482f70fad9ff13824.tar.bz2 portage-c42591b5d0484459837da28482f70fad9ff13824.zip |
emerge: add --complete-graph-if-new-use < y | n >
Trigger the --complete-graph behavior if USE or IUSE will change for
an installed package. This option is enabled by default. This will fix
bug #425558.
Diffstat (limited to 'pym/portage/tests/resolver')
-rw-r--r-- | pym/portage/tests/resolver/test_complete_graph.py | 66 |
1 files changed, 65 insertions, 1 deletions
diff --git a/pym/portage/tests/resolver/test_complete_graph.py b/pym/portage/tests/resolver/test_complete_graph.py index 850b883b4..1b0342c67 100644 --- a/pym/portage/tests/resolver/test_complete_graph.py +++ b/pym/portage/tests/resolver/test_complete_graph.py @@ -1,4 +1,4 @@ -# Copyright 2011 Gentoo Foundation +# Copyright 2011-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from portage.tests import TestCase @@ -7,6 +7,70 @@ from portage.tests.resolver.ResolverPlayground import (ResolverPlayground, class CompleteGraphTestCase(TestCase): + def testCompleteGraphUseChange(self): + """ + Prevent reverse dependency breakage triggered by USE changes. + """ + + ebuilds = { + "dev-libs/libxml2-2.8.0": { + "EAPI": "2", + "IUSE": "+icu", + "SLOT": "2", + }, + "x11-libs/qt-webkit-4.8.2": { + "EAPI": "2", + "IUSE": "icu", + "RDEPEND" : "dev-libs/libxml2:2[!icu?]", + }, + } + + installed = { + "dev-libs/libxml2-2.8.0": { + "EAPI": "2", + "IUSE": "+icu", + "USE": "", + "SLOT": "2", + }, + "x11-libs/qt-webkit-4.8.2": { + "EAPI": "2", + "IUSE": "icu", + "RDEPEND" : "dev-libs/libxml2:2[-icu]", + "USE": "", + } + } + + world = ["x11-libs/qt-webkit"] + + test_cases = ( + + ResolverPlaygroundTestCase( + ["dev-libs/libxml2"], + options = {"--complete-graph-if-new-use" : "y" }, + mergelist = ["dev-libs/libxml2-2.8.0"], + slot_collision_solutions = [{'dev-libs/libxml2-2.8.0': {'icu': False}}], + success = False, + ), + + ResolverPlaygroundTestCase( + ["dev-libs/libxml2"], + options = {"--complete-graph-if-new-use" : "n" }, + mergelist = ["dev-libs/libxml2-2.8.0"], + success = True, + ), + + ) + + 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() + def testCompleteGraphVersionChange(self): """ Prevent reverse dependency breakage triggered by version changes. |