1 # Copyright 2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 from portage.tests import TestCase
5 from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
6 ResolverPlaygroundTestCase)
8 class FeaturesTestUse(TestCase):
10 def testFeaturesTestUse(self):
32 "make.conf" : ("FEATURES=test", "USE=\"-test -foo\"")
37 # USE=test state should not trigger --newuse rebuilds, as
38 # specified in bug #373209, comment #3.
39 ResolverPlaygroundTestCase(
41 options = {"--newuse": True, "--selective": True},
45 # USE=-test -> USE=test, with USE=test forced by FEATURES=test
46 ResolverPlaygroundTestCase(
50 mergelist = ["dev-libs/A-1"]),
52 # USE=foo -> USE=-foo, with USE=test forced by FEATURES=test
53 ResolverPlaygroundTestCase(
55 options = {"--newuse": True, "--selective": True},
57 mergelist = ["dev-libs/B-1"]),
60 playground = ResolverPlayground(ebuilds=ebuilds,
61 installed=installed, user_config=user_config, debug=False)
63 for test_case in test_cases:
64 playground.run_TestCase(test_case)
65 self.assertEqual(test_case.test_success, True, test_case.fail_msg)