* [gentoo-portage-dev] [PATCH] Add a test case for --newuse, --changed-use, and --binpkg-respect-use.
@ 2014-02-20 18:43 David James
0 siblings, 0 replies; 5+ messages in thread
From: David James @ 2014-02-20 18:43 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: vapier, David James
Change-Id: I201e468c6e7cda6aa961371ad9ddc10cfab04bc7
---
pym/portage/tests/resolver/test_useflags.py | 78 +++++++++++++++++++++++++++++
1 file changed, 78 insertions(+)
create mode 100644 pym/portage/tests/resolver/test_useflags.py
diff --git a/pym/portage/tests/resolver/test_useflags.py b/pym/portage/tests/resolver/test_useflags.py
new file mode 100644
index 0000000..0a5f3b3
--- /dev/null
+++ b/pym/portage/tests/resolver/test_useflags.py
@@ -0,0 +1,78 @@
+# Copyright 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 UseFlagsTestCase(TestCase):
+
+ def testUseFlags(self):
+ ebuilds = {
+ "dev-libs/A-1": { "IUSE": "X", },
+ "dev-libs/B-1": { "IUSE": "X Y", },
+ }
+
+ installed = {
+ "dev-libs/A-1": { "IUSE": "X", },
+ "dev-libs/B-1": { "IUSE": "X", },
+ }
+
+ binpkgs = installed
+
+ user_config = {
+ "package.use": ( "dev-libs/A X", ),
+ "use.force": ( "Y", ),
+ }
+
+ test_cases = (
+ #default: don't reinstall on use flag change
+ ResolverPlaygroundTestCase(
+ ["dev-libs/A"],
+ options = {"--selective": True, "--usepkg": True},
+ success = True,
+ mergelist = []),
+
+ #default: respect use flags for binpkgs
+ ResolverPlaygroundTestCase(
+ ["dev-libs/A"],
+ options = {"--usepkg": True},
+ success = True,
+ mergelist = ["dev-libs/A-1"]),
+
+ #--binpkg-respect-use=n: use binpkgs with different use flags
+ ResolverPlaygroundTestCase(
+ ["dev-libs/A"],
+ options = {"--binpkg-respect-use": "n", "--usepkg": True},
+ success = True,
+ mergelist = ["[binary]dev-libs/A-1"]),
+
+ #--reinstall=changed-use: reinstall if use flag changed
+ ResolverPlaygroundTestCase(
+ ["dev-libs/A"],
+ options = {"--reinstall": "changed-use", "--usepkg": True},
+ success = True,
+ mergelist = ["dev-libs/A-1"]),
+
+ #--reinstall=changed-use: don't reinstall on new use flag
+ ResolverPlaygroundTestCase(
+ ["dev-libs/B"],
+ options = {"--reinstall": "changed-use", "--usepkg": True},
+ success = True,
+ mergelist = []),
+
+ #--newuse: reinstall on new use flag
+ ResolverPlaygroundTestCase(
+ ["dev-libs/B"],
+ options = {"--newuse": True, "--usepkg": True},
+ success = True,
+ mergelist = ["dev-libs/B-1"]),
+ )
+
+ playground = ResolverPlayground(ebuilds=ebuilds,
+ binpkgs=binpkgs, installed=installed, user_config=user_config)
+ 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()
--
1.8.0.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-portage-dev] [PATCH] Add a test case for --newuse, --changed-use, and --binpkg-respect-use.
@ 2014-02-24 18:14 David James
2014-02-24 18:56 ` Brian Dolbec
0 siblings, 1 reply; 5+ messages in thread
From: David James @ 2014-02-24 18:14 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: vapier, David James
Change-Id: I201e468c6e7cda6aa961371ad9ddc10cfab04bc7
---
pym/portage/tests/resolver/test_useflags.py | 78 +++++++++++++++++++++++++++++
1 file changed, 78 insertions(+)
create mode 100644 pym/portage/tests/resolver/test_useflags.py
diff --git a/pym/portage/tests/resolver/test_useflags.py b/pym/portage/tests/resolver/test_useflags.py
new file mode 100644
index 0000000..0a5f3b3
--- /dev/null
+++ b/pym/portage/tests/resolver/test_useflags.py
@@ -0,0 +1,78 @@
+# Copyright 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 UseFlagsTestCase(TestCase):
+
+ def testUseFlags(self):
+ ebuilds = {
+ "dev-libs/A-1": { "IUSE": "X", },
+ "dev-libs/B-1": { "IUSE": "X Y", },
+ }
+
+ installed = {
+ "dev-libs/A-1": { "IUSE": "X", },
+ "dev-libs/B-1": { "IUSE": "X", },
+ }
+
+ binpkgs = installed
+
+ user_config = {
+ "package.use": ( "dev-libs/A X", ),
+ "use.force": ( "Y", ),
+ }
+
+ test_cases = (
+ #default: don't reinstall on use flag change
+ ResolverPlaygroundTestCase(
+ ["dev-libs/A"],
+ options = {"--selective": True, "--usepkg": True},
+ success = True,
+ mergelist = []),
+
+ #default: respect use flags for binpkgs
+ ResolverPlaygroundTestCase(
+ ["dev-libs/A"],
+ options = {"--usepkg": True},
+ success = True,
+ mergelist = ["dev-libs/A-1"]),
+
+ #--binpkg-respect-use=n: use binpkgs with different use flags
+ ResolverPlaygroundTestCase(
+ ["dev-libs/A"],
+ options = {"--binpkg-respect-use": "n", "--usepkg": True},
+ success = True,
+ mergelist = ["[binary]dev-libs/A-1"]),
+
+ #--reinstall=changed-use: reinstall if use flag changed
+ ResolverPlaygroundTestCase(
+ ["dev-libs/A"],
+ options = {"--reinstall": "changed-use", "--usepkg": True},
+ success = True,
+ mergelist = ["dev-libs/A-1"]),
+
+ #--reinstall=changed-use: don't reinstall on new use flag
+ ResolverPlaygroundTestCase(
+ ["dev-libs/B"],
+ options = {"--reinstall": "changed-use", "--usepkg": True},
+ success = True,
+ mergelist = []),
+
+ #--newuse: reinstall on new use flag
+ ResolverPlaygroundTestCase(
+ ["dev-libs/B"],
+ options = {"--newuse": True, "--usepkg": True},
+ success = True,
+ mergelist = ["dev-libs/B-1"]),
+ )
+
+ playground = ResolverPlayground(ebuilds=ebuilds,
+ binpkgs=binpkgs, installed=installed, user_config=user_config)
+ 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()
--
1.8.0.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] Add a test case for --newuse, --changed-use, and --binpkg-respect-use.
2014-02-24 18:14 David James
@ 2014-02-24 18:56 ` Brian Dolbec
2014-02-24 19:03 ` David James
0 siblings, 1 reply; 5+ messages in thread
From: Brian Dolbec @ 2014-02-24 18:56 UTC (permalink / raw
To: gentoo-portage-dev
On Mon, 24 Feb 2014 10:14:26 -0800
David James <davidjames@google.com> wrote:
> Change-Id: I201e468c6e7cda6aa961371ad9ddc10cfab04bc7
> ---
> pym/portage/tests/resolver/test_useflags.py | 78 +++++++++++++++++++++++++++++
> 1 file changed, 78 insertions(+)
> create mode 100644 pym/portage/tests/resolver/test_useflags.py
>
>
Was there a difference in this posting to the one last Thursday?
If not a simple bump reminder was all that should have been done.
If it is different, they you should have created the patch with the
-v 2 format-patch option. And summarized the changes.
Sebastian I believe, has had the most experience with the tests, so I
will leave the review up to him, Mike.
--
Brian Dolbec <dolsen>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] Add a test case for --newuse, --changed-use, and --binpkg-respect-use.
2014-02-24 18:56 ` Brian Dolbec
@ 2014-02-24 19:03 ` David James
2014-02-24 20:07 ` Sebastian Luther
0 siblings, 1 reply; 5+ messages in thread
From: David James @ 2014-02-24 19:03 UTC (permalink / raw
To: gentoo-portage-dev
[-- Attachment #1: Type: text/plain, Size: 899 bytes --]
On Mon, Feb 24, 2014 at 10:56 AM, Brian Dolbec <dolsen@gentoo.org> wrote:
> On Mon, 24 Feb 2014 10:14:26 -0800
> David James <davidjames@google.com> wrote:
>
> > Change-Id: I201e468c6e7cda6aa961371ad9ddc10cfab04bc7
> > ---
> > pym/portage/tests/resolver/test_useflags.py | 78
> +++++++++++++++++++++++++++++
> > 1 file changed, 78 insertions(+)
> > create mode 100644 pym/portage/tests/resolver/test_useflags.py
> >
> >
>
> Was there a difference in this posting to the one last Thursday?
>
> If not a simple bump reminder was all that should have been done.
>
> If it is different, they you should have created the patch with the
> -v 2 format-patch option. And summarized the changes.
>
> Sebastian I believe, has had the most experience with the tests, so I
> will leave the review up to him, Mike.
It's the same patch -- I just accidentally sent it twice. So consider this
a bump, then.
[-- Attachment #2: Type: text/html, Size: 1383 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] Add a test case for --newuse, --changed-use, and --binpkg-respect-use.
2014-02-24 19:03 ` David James
@ 2014-02-24 20:07 ` Sebastian Luther
0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Luther @ 2014-02-24 20:07 UTC (permalink / raw
To: gentoo-portage-dev
Am 24.02.2014 20:03, schrieb David James:
> It's the same patch -- I just accidentally sent it twice. So consider
> this a bump, then.
>
Sorry, I saw your first mail, but somehow forgot about it. Committed now.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-02-24 20:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-20 18:43 [gentoo-portage-dev] [PATCH] Add a test case for --newuse, --changed-use, and --binpkg-respect-use David James
-- strict thread matches above, loose matches on Subject: below --
2014-02-24 18:14 David James
2014-02-24 18:56 ` Brian Dolbec
2014-02-24 19:03 ` David James
2014-02-24 20:07 ` Sebastian Luther
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox