llvm.org GIT mirror llvm / 4b3e5f2
[lit] Allow config files to pass arbitrary values to child configs. - This aligns with how existing test suites end up wanting to use the local config files, conceptually it makes sense to consider them to be inherited. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189885 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 6 years ago
4 changed file(s) with 8 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
113113 self.available_features = set(available_features)
114114 self.pipefail = pipefail
115115
116 def clone(self):
117 # FIXME: Chain implementations?
118 #
119 # FIXME: Allow extra parameters?
120 return TestingConfig(self, self.name, self.suffixes, self.test_format,
121 self.environment, self.substitutions,
122 self.unsupported,
123 self.test_exec_root, self.test_source_root,
124 self.excludes, self.available_features,
125 self.pipefail)
126
127116 def finish(self, litConfig):
128117 """finish() - Finish this config object, after loading is complete."""
129118
11 Test discovery functions.
22 """
33
4 import copy
45 import os
56 import sys
67
8990
9091 # Otherwise, copy the current config and load the local configuration
9192 # file into it.
92 config = parent.clone()
93 config = copy.copy(parent)
9394 if litConfig.debug:
9495 litConfig.note('loading local config %r' % cfgpath)
9596 config.load_from_path(cfgpath, litConfig)
88 #
99 #config.test_source_root = None
1010 #config.test_exec_root = None
11
12 # Check that arbitrary config values are copied (tested by subdir/lit.local.cfg).
13 config.an_extra_variable = False
0 config.suffixes = ['.py']
1
2 # Check that the arbitrary config values in our parent was inherited.
3 assert hasattr(config, 'an_extra_variable')