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,
32 available_features = [])
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,
62 self.suffixes = set(suffixes)
63 self.test_format = test_format
64 self.environment = dict(environment)
65 self.substitutions = list(substitutions)
66 self.unsupported = unsupported
67 self.on_clone = on_clone
68 self.test_exec_root = test_exec_root
69 self.test_source_root = test_source_root
70 self.excludes = set(excludes)
71 self.available_features = set(available_features)
73 def clone(self, path):
74 # FIXME: Chain implementations?
76 # FIXME: Allow extra parameters?
77 cfg = TestingConfig(self, self.name, self.suffixes, self.test_format,
78 self.environment, self.substitutions,
79 self.unsupported, self.on_clone,
80 self.test_exec_root, self.test_source_root,
81 self.excludes, self.available_features)
83 cfg.on_clone(self, cfg, path)
86 def finish(self, litConfig):
87 """finish() - Finish this config object, after loading is complete."""
89 self.name = str(self.name)
90 self.suffixes = set(self.suffixes)
91 self.environment = dict(self.environment)
92 self.substitutions = list(self.substitutions)
93 if self.test_exec_root is not None:
94 # FIXME: This should really only be suite in test suite config
95 # files. Should we distinguish them?
96 self.test_exec_root = str(self.test_exec_root)
97 if self.test_source_root is not None:
98 # FIXME: This should really only be suite in test suite config
99 # files. Should we distinguish them?
100 self.test_source_root = str(self.test_source_root)
101 self.excludes = set(self.excludes)