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 'PATH' : os.pathsep.join(litConfig.path +
14 [os.environ.get('PATH','')]),
15 'SYSTEMROOT' : os.environ.get('SYSTEMROOT',''),
16 'LLVM_DISABLE_CRT_DEBUG' : '1',
19 config = TestingConfig(parent,
23 environment = environment,
27 test_exec_root = None,
28 test_source_root = None,
31 if os.path.exists(path):
32 # FIXME: Improve detection and error reporting of errors in the
35 cfg_globals = dict(globals())
36 cfg_globals['config'] = config
37 cfg_globals['lit'] = litConfig
38 cfg_globals['__file__'] = path
41 except SystemExit,status:
42 # We allow normal system exit inside a config file to just
43 # return control without error.
48 litConfig.fatal('unable to load config from %r ' % path)
50 config.finish(litConfig)
53 def __init__(self, parent, name, suffixes, test_format,
54 environment, substitutions, unsupported, on_clone,
55 test_exec_root, test_source_root, excludes):
58 self.suffixes = set(suffixes)
59 self.test_format = test_format
60 self.environment = dict(environment)
61 self.substitutions = list(substitutions)
62 self.unsupported = unsupported
63 self.on_clone = on_clone
64 self.test_exec_root = test_exec_root
65 self.test_source_root = test_source_root
66 self.excludes = set(excludes)
68 def clone(self, path):
69 # FIXME: Chain implementations?
71 # FIXME: Allow extra parameters?
72 cfg = TestingConfig(self, self.name, self.suffixes, self.test_format,
73 self.environment, self.substitutions,
74 self.unsupported, self.on_clone,
75 self.test_exec_root, self.test_source_root,
78 cfg.on_clone(self, cfg, path)
81 def finish(self, litConfig):
82 """finish() - Finish this config object, after loading is complete."""
84 self.name = str(self.name)
85 self.suffixes = set(self.suffixes)
86 self.environment = dict(self.environment)
87 self.substitutions = list(self.substitutions)
88 if self.test_exec_root is not None:
89 # FIXME: This should really only be suite in test suite config
90 # files. Should we distinguish them?
91 self.test_exec_root = str(self.test_exec_root)
92 if self.test_source_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_source_root = str(self.test_source_root)
96 self.excludes = set(self.excludes)