[lit] Eliminate parent argument from TestingConfig.frompath(), which is effectively...
authorDaniel Dunbar <daniel@zuster.org>
Fri, 9 Aug 2013 00:08:46 +0000 (00:08 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 9 Aug 2013 00:08:46 +0000 (00:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188032 91177308-0d34-0410-b5e6-96231b3b80d8

utils/lit/lit/LitConfig.py
utils/lit/lit/TestingConfig.py
utils/lit/lit/discovery.py

index c183613133227daee5eff9066c9c3a58be87a42b..d493b33daa2a1926c44bb5b02cd7f50642f8b578 100644 (file)
@@ -73,7 +73,7 @@ class LitConfig:
         if self.debug:
             self.note('load_config from %r' % path)
         return lit.TestingConfig.TestingConfig.frompath(
-            path, config.parent, self, mustExist = True, config = config)
+            path, config, self, mustExist = True)
 
     def getBashPath(self):
         """getBashPath - Get the path to 'bash'"""
index d4d218b5702a933aadd8cca6ba47572f8b66b450..6df84b6815a60c76b7547f6545350d25e5a6e86d 100644 (file)
@@ -9,7 +9,14 @@ class TestingConfig:
     """
 
     @staticmethod
-    def frompath(path, parent, litConfig, mustExist, config = None):
+    def frompath(path, config, litConfig, mustExist):
+        """
+        frompath(path, config, litConfig, mustExist) -> TestingConfig
+
+        Load the configuration module at the provided path into the given config
+        object (or create a new one if None is provided) and return the config.
+        """
+
         if config is None:
             # Set the environment based on the command line arguments.
             environment = {
@@ -38,7 +45,7 @@ class TestingConfig:
                 if litConfig.valgrindLeakCheck:
                     available_features.append('vg_leak')
 
-            config = TestingConfig(parent,
+            config = TestingConfig(None,
                                    name = '<unnamed>',
                                    suffixes = set(),
                                    test_format = None,
index f76bd22075f4956947970c5f0fe4041160d6e249..35b29c62d5576eaa549b25dd518450e2031630cb 100644 (file)
@@ -83,9 +83,8 @@ def getLocalConfig(ts, path_in_suite, litConfig, cache):
         cfgpath = os.path.join(source_path, litConfig.local_config_name)
         if litConfig.debug:
             litConfig.note('loading local config %r' % cfgpath)
-        return TestingConfig.frompath(cfgpath, parent, litConfig,
-                                    mustExist = False,
-                                    config = parent.clone(cfgpath))
+        return TestingConfig.frompath(cfgpath, parent.clone(cfgpath), litConfig,
+                                      mustExist = False)
 
     def search(path_in_suite):
         key = (ts, path_in_suite)