5
TestingConfig - Information on the tests inside a suite.
9
def frompath(path, parent, litConfig, mustExist, config = None):
11
# Set the environment based on the command line arguments.
13
'LD_LIBRARY_PATH' : os.environ.get('LD_LIBRARY_PATH',''),
14
'PATH' : os.pathsep.join(litConfig.path +
15
[os.environ.get('PATH','')]),
16
'PATHEXT' : os.environ.get('PATHEXT',''),
17
'SYSTEMROOT' : os.environ.get('SYSTEMROOT',''),
18
'LLVM_DISABLE_CRT_DEBUG' : '1',
21
config = TestingConfig(parent,
25
environment = environment,
29
test_exec_root = None,
30
test_source_root = None,
34
if os.path.exists(path):
35
# FIXME: Improve detection and error reporting of errors in the
38
cfg_globals = dict(globals())
39
cfg_globals['config'] = config
40
cfg_globals['lit'] = litConfig
41
cfg_globals['__file__'] = path
44
except SystemExit,status:
45
# We allow normal system exit inside a config file to just
46
# return control without error.
51
litConfig.fatal('unable to load config from %r ' % path)
53
config.finish(litConfig)
56
def __init__(self, parent, name, suffixes, test_format,
57
environment, substitutions, unsupported, on_clone,
58
test_exec_root, test_source_root, excludes, conditions):
61
self.suffixes = set(suffixes)
62
self.test_format = test_format
63
self.environment = dict(environment)
64
self.substitutions = list(substitutions)
65
self.unsupported = unsupported
66
self.on_clone = on_clone
67
self.test_exec_root = test_exec_root
68
self.test_source_root = test_source_root
69
self.excludes = set(excludes)
70
self.conditions = dict(conditions)
72
def clone(self, path):
73
# FIXME: Chain implementations?
75
# FIXME: Allow extra parameters?
76
cfg = TestingConfig(self, self.name, self.suffixes, self.test_format,
77
self.environment, self.substitutions,
78
self.unsupported, self.on_clone,
79
self.test_exec_root, self.test_source_root,
80
self.excludes, self.conditions)
82
cfg.on_clone(self, cfg, path)
85
def finish(self, litConfig):
86
"""finish() - Finish this config object, after loading is complete."""
88
self.name = str(self.name)
89
self.suffixes = set(self.suffixes)
90
self.environment = dict(self.environment)
91
self.substitutions = list(self.substitutions)
92
if self.test_exec_root is not None:
93
# FIXME: This should really only be suite in test suite config
94
# files. Should we distinguish them?
95
self.test_exec_root = str(self.test_exec_root)
96
if self.test_source_root is not None:
97
# FIXME: This should really only be suite in test suite config
98
# files. Should we distinguish them?
99
self.test_source_root = str(self.test_source_root)
100
self.excludes = set(self.excludes)