3 # Configuration file for the 'lit' test runner.
12 # name: The name of this test suite.
13 config
.name
= 'Clang-Unit'
15 # suffixes: A list of file extensions to treat as test files.
18 # test_source_root: The root path where tests are located.
19 # test_exec_root: The root path where tests should be run.
20 config
.test_exec_root
= os
.path
.join(config
.clang_obj_root
, 'unittests')
21 config
.test_source_root
= config
.test_exec_root
23 # testFormat: The test format to use to interpret tests.
24 config
.test_format
= lit
.formats
.GoogleTest(config
.llvm_build_mode
, 'Tests')
26 # Propagate the temp directory. Windows requires this because it uses \Windows\
27 # if none of these are present.
28 if 'TMP' in os
.environ
:
29 config
.environment
['TMP'] = os
.environ
['TMP']
30 if 'TEMP' in os
.environ
:
31 config
.environment
['TEMP'] = os
.environ
['TEMP']
33 if 'HOME' in os
.environ
:
34 config
.environment
['HOME'] = os
.environ
['HOME']
36 # Propagate sanitizer options.
38 'ASAN_SYMBOLIZER_PATH',
39 'HWASAN_SYMBOLIZER_PATH',
40 'MSAN_SYMBOLIZER_PATH',
41 'TSAN_SYMBOLIZER_PATH',
42 'UBSAN_SYMBOLIZER_PATH',
50 config
.environment
[var
] = os
.environ
[var
]
52 def find_shlibpath_var():
53 if platform
.system() in ['Linux', 'FreeBSD', 'NetBSD', 'OpenBSD', 'SunOS']:
54 yield 'LD_LIBRARY_PATH'
55 elif platform
.system() == 'Darwin':
56 yield 'DYLD_LIBRARY_PATH'
57 elif platform
.system() == 'Windows':
59 elif platform
.system() == 'AIX':
62 for shlibpath_var
in find_shlibpath_var():
63 # in stand-alone builds, shlibdir is clang's build tree
64 # while llvm_libs_dir is installed LLVM (and possibly older clang)
65 shlibpath
= os
.path
.pathsep
.join(
68 config
.environment
.get(shlibpath_var
, '')))
69 config
.environment
[shlibpath_var
] = shlibpath
72 lit_config
.warning("unable to inject shared library path on '{}'"
73 .format(platform
.system()))
75 # It is not realistically possible to account for all options that could
76 # possibly be present in system and user configuration files, so disable
77 # default configs for the test runs.
78 config
.environment
["CLANG_NO_DEFAULT_CONFIG"] = "1"