8 # Configuration file for the 'lit' test runner.
10 # name: The name of this test suite.
13 # testFormat: The test format to use to interpret tests.
14 config.test_format = lit.formats.ShTest(execute_external=False)
16 # suffixes: A list of file extensions to treat as test files.
17 config.suffixes = ['.py']
19 # excludes: A list of individual files to exclude.
20 config.excludes = ['Inputs']
22 # test_source_root: The root path where tests are located.
23 config.test_source_root = os.path.dirname(__file__)
24 config.test_exec_root = config.test_source_root
26 config.target_triple = '(unused)'
28 src_root = os.path.join(config.test_source_root, '..')
29 config.environment['PYTHONPATH'] = src_root
30 config.substitutions.append(('%{src_root}', src_root))
31 config.substitutions.append(('%{inputs}', os.path.join(
32 src_root, 'tests', 'Inputs')))
33 config.substitutions.append(('%{lit}', "%%{python} %s" % (
34 os.path.join(src_root, 'lit.py'),)))
35 config.substitutions.append(('%{python}', sys.executable))
37 # Enable coverage.py reporting, assuming the coverage module has been installed
38 # and sitecustomize.py in the virtualenv has been modified appropriately.
39 if lit_config.params.get('check-coverage', None):
40 config.environment['COVERAGE_PROCESS_START'] = os.path.join(
41 os.path.dirname(__file__), ".coveragerc")
43 # Add a feature to detect the Python version.
44 config.available_features.add("python%d.%d" % (sys.version_info[0],
47 # Add a feature to detect if psutil is available
50 lit_config.note('Found python psutil module')
51 config.available_features.add("python-psutil")
53 lit_config.warning('Could not import psutil. Some tests will be skipped and'
54 ' the --timeout command line argument will not work.')