summaryrefslogtreecommitdiffstats
path: root/pym/portage
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-02-02 13:29:42 -0800
committerZac Medico <zmedico@gentoo.org>2011-02-02 15:34:30 -0800
commit921c06a30e8717381160611e4845f1b674f010a4 (patch)
tree389d88761ccdd89437a6c54321180d123f425877 /pym/portage
parent8ac5e653a0c23015e1b0a0cf4530a79885ee14a4 (diff)
downloadportage-921c06a30e8717381160611e4845f1b674f010a4.tar.gz
portage-921c06a30e8717381160611e4845f1b674f010a4.tar.bz2
portage-921c06a30e8717381160611e4845f1b674f010a4.zip
Make || choices independent of REQUIRED_USE.
Diffstat (limited to 'pym/portage')
-rw-r--r--pym/portage/tests/resolver/test_required_use.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/pym/portage/tests/resolver/test_required_use.py b/pym/portage/tests/resolver/test_required_use.py
index 90ccb3da0..c8810faef 100644
--- a/pym/portage/tests/resolver/test_required_use.py
+++ b/pym/portage/tests/resolver/test_required_use.py
@@ -1,4 +1,4 @@
-# Copyright 2010 Gentoo Foundation
+# Copyright 2010-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from portage.tests import TestCase
@@ -88,3 +88,27 @@ class RequiredUSETestCase(TestCase):
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
+
+ def testRequiredUseOrDeps(self):
+
+ ebuilds = {
+ "dev-libs/A-1": { "IUSE": "+x +y", "REQUIRED_USE": "^^ ( x y )", "EAPI": "4" },
+ "dev-libs/B-1": { "IUSE": "+x +y", "REQUIRED_USE": "", "EAPI": "4" },
+ "app-misc/p-1": { "RDEPEND": "|| ( =dev-libs/A-1 =dev-libs/B-1 )" },
+ }
+
+ test_cases = (
+ # This should fail and show a REQUIRED_USE error for
+ # dev-libs/A-1, since this choice it preferred.
+ ResolverPlaygroundTestCase(
+ ["=app-misc/p-1"],
+ success = False),
+ )
+
+ playground = ResolverPlayground(ebuilds=ebuilds)
+ 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()