1 # -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79:
2 # Configuration file for the 'lit' test runner.
6 site.addsitedir(os.path.dirname(__file__))
9 # Tell pylint that we know config and lit_config exist somewhere.
10 if 'PYLINT_IMPORT' in os.environ:
14 # name: The name of this test suite.
15 config.name = 'libc++'
17 # suffixes: A list of file extensions to treat as test files.
18 config.suffixes = ['.pass.cpp', '.fail.cpp', '.sh.cpp']
20 # test_source_root: The root path where tests are located.
21 config.test_source_root = os.path.dirname(__file__)
23 # Infer the test_exec_root from the libcxx_object root.
24 obj_root = getattr(config, 'libcxx_obj_root', None)
26 # Check that the test exec root is known.
28 import libcxx.test.config
29 libcxx.test.config.loadSiteConfig(lit_config, config, 'libcxx_site_config',
31 obj_root = getattr(config, 'libcxx_obj_root', None)
34 obj_root = tempfile.mkdtemp(prefix='libcxx-testsuite-')
35 lit_config.warning('Creating temporary directory for object root: %s' %
38 config.test_exec_root = os.path.join(obj_root, 'test')
40 cfg_variant = getattr(config, 'configuration_variant', 'libcxx')
42 lit_config.note('Using configuration variant: %s' % cfg_variant)
44 # Load the Configuration class from the module name <cfg_variant>.test.config.
45 config_module_name = '.'.join([cfg_variant, 'test', 'config'])
46 config_module = __import__(config_module_name, fromlist=['Configuration'])
48 configuration = config_module.Configuration(lit_config, config)
49 configuration.configure()
50 configuration.print_config_info()
51 config.test_format = configuration.get_test_format()