Tests: ResolverPlayground: add debug option to not supress depgraph output
authorSebastian Luther <SebastianLuther@gmx.de>
Thu, 12 Aug 2010 12:00:13 +0000 (14:00 +0200)
committerZac Medico <zmedico@gentoo.org>
Thu, 12 Aug 2010 12:34:19 +0000 (05:34 -0700)
Useful for debugging test cases.

pym/portage/tests/resolver/ResolverPlayground.py

index d085b40d38260213c187ddd8b54f7833b5ae4f2e..9440378c7de731d8f02b567b92c9ebd07ad80791 100644 (file)
@@ -27,13 +27,14 @@ class ResolverPlayground(object):
        it's work.
        """
        
-       def __init__(self, ebuilds={}, installed={}, profile={}, world=[]):
+       def __init__(self, ebuilds={}, installed={}, profile={}, world=[], debug=False):
                """
                ebuilds: cpv -> metadata mapping simulating avaiable ebuilds. 
                installed: cpv -> metadata mapping simulating installed packages.
                        If a metadata key is missing, it gets a default value.
                profile: settings defined by the profile.
                """
+               self.debug = debug
                self.root = tempfile.mkdtemp() + os.path.sep
                self.portdir = os.path.join(self.root, "usr/portage")
                self.vdbdir = os.path.join(self.root, "var/db/pkg")
@@ -236,7 +237,8 @@ class ResolverPlayground(object):
                # conditional test code.
                options["_test_"] = True
 
-               portage.util.noiselimit = -2
+               if not self.debug:
+                       portage.util.noiselimit = -2
                params = create_depgraph_params(options, action)
                success, depgraph, favorites = backtrack_depgraph(
                        self.settings, self.trees, options, params, action, atoms, None)