llvm.org GIT mirror llvm / cc85160
Continue cleanup of LIT, getting rid of the remaining artifacts from dejagnu * Removed test/lib/llvm.exp - it is no longer needed * Deleted the dg.exp reading code from test/lit.cfg. There are no dg.exp files left in the test suite so this code is no longer required. test/lit.cfg is now much shorter and clearer * Removed a lot of duplicate code in lit.local.cfg files that need access to the root configuration, by adding a "root" attribute to the TestingConfig object. This attribute is dynamically computed to provide the same information as was previously provided by the custom getRoot functions. * Documented the config.root attribute in docs/CommandGuide/lit.pod git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153408 91177308-0d34-0410-b5e6-96231b3b80d8 Eli Bendersky 8 years ago
40 changed file(s) with 45 addition(s) and 352 deletion(s). Raw diff Collapse all Expand all
299299
300300 B The parent configuration, this is the config object for the directory
301301 containing the test suite, or None.
302
303 B The root configuration. This is the top-most B configuration in
304 the project.
302305
303306 B The config is actually cloned for every subdirectory inside a test
304307 suite, to allow local configuration on a per-directory basis. The I
0 config.suffixes = ['.ll', '.c', '.cpp', '.ml']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 bindings = set([s.strip() for s in root.llvm_bindings.split(',')])
2 bindings = set([s.strip() for s in config.root.llvm_bindings.split(',')])
103 if not 'ocaml' in bindings:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'ARM' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'CBackend' in targets or not 'X86' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'CBackend' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'CppBackend' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'CellSPU' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'Hexagon' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'MBlaze' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'MSP430' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'Mips' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'PTX' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'PowerPC' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'Sparc' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'ARM' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'ARM' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'X86' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'X86' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'XCore' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'X86' in targets:
114 config.unsupported = True
0 config.suffixes = ['.ll', '.c', '.cpp', '.s']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'ARM' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.s']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'X86' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.s', '.ll']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'X86' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.txt']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'ARM' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.txt']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'MBlaze' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.txt']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'X86' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.s']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'X86' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp', '.s']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'MBlaze' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.s']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'ARM' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.s']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'X86' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp', '.s']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'Mips' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.test']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'X86' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'X86' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'ARM' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'X86' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'X86' in targets:
114 config.unsupported = True
125
0 config.suffixes = ['.ll', '.c', '.cpp']
11
2 def getRoot(config):
3 if not config.parent:
4 return config
5 return getRoot(config.parent)
6
7 root = getRoot(config)
8
9 targets = set(root.targets_to_build.split())
2 targets = set(config.root.targets_to_build.split())
103 if not 'X86' in targets:
114 config.unsupported = True
+0
-0
test/lib/llvm.exp less more
(Empty file)
217217 break
218218 config.substitutions.append((pattern, substitution))
219219
220 excludes = []
221
222 # Provide llvm_supports_target for use in local configs.
223 targets = set(site_exp["TARGETS_TO_BUILD"].split())
224 def llvm_supports_target(name):
225 return name in targets
226
227 def llvm_supports_darwin_and_target(name):
228 return 'darwin' in config.target_triple and llvm_supports_target(name)
229
230 bindings = set([s.strip() for s in site_exp['llvm_bindings'].split(',')])
231 def llvm_supports_binding(name):
232 return name.strip() in bindings
233
234 # Provide on_clone hook for reading 'dg.exp'.
235 import os
236 simpleLibData = re.compile(r"""load_lib llvm.exp
237
238 RunLLVMTests \[lsort \[glob -nocomplain \$srcdir/\$subdir/\*\.(.*)\]\]""",
239 re.MULTILINE)
240 conditionalLibData = re.compile(r"""load_lib llvm.exp
241
242 if.*\[ ?(llvm[^ ]*) ([^ ]*) ?\].*{
243 *RunLLVMTests \[lsort \[glob -nocomplain \$srcdir/\$subdir/\*\.(.*)\]\]
244 \}""", re.MULTILINE)
245 def on_clone(parent, cfg, for_path):
246 def addSuffixes(match):
247 if match[0] == '{' and match[-1] == '}':
248 cfg.suffixes = ['.' + s for s in match[1:-1].split(',')]
249 else:
250 cfg.suffixes = ['.' + match]
251
252 libPath = os.path.join(os.path.dirname(for_path),
253 'dg.exp')
254 if not os.path.exists(libPath):
255 return
256
257 # Reset unsupported, in case we inherited it.
258 cfg.unsupported = False
259 lib = open(libPath).read().strip()
260
261 # Check for a simple library.
262 m = simpleLibData.match(lib)
263 if m:
264 addSuffixes(m.group(1))
265 return
266
267 # Check for a conditional test set.
268 m = conditionalLibData.match(lib)
269 if m:
270 funcname,arg,match = m.groups()
271 addSuffixes(match)
272
273 func = globals().get(funcname)
274 if not func:
275 lit.error('unsupported predicate %r' % funcname)
276 elif not func(arg):
277 cfg.unsupported = True
278 return
279 # Otherwise, give up.
280 lit.error('unable to understand %r:\n%s' % (libPath, lib))
281
282 config.on_clone = on_clone
283
284220 ### Features
285221
286222 # Shell execution
113113 # files. Should we distinguish them?
114114 self.test_source_root = str(self.test_source_root)
115115 self.excludes = set(self.excludes)
116
117 @property
118 def root(self):
119 """root attribute - The root configuration for the test suite."""
120 return self if self.parent is None else self.parent.root
121