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
]
53 def find_shlibpath_var():
54 if platform
.system() in ["Linux", "FreeBSD", "NetBSD", "OpenBSD", "SunOS"]:
55 yield "LD_LIBRARY_PATH"
56 elif platform
.system() == "Darwin":
57 yield "DYLD_LIBRARY_PATH"
58 elif platform
.system() == "Windows":
60 elif platform
.system() == "AIX":
64 for shlibpath_var
in find_shlibpath_var():
65 # in stand-alone builds, shlibdir is clang's build tree
66 # while llvm_libs_dir is installed LLVM (and possibly older clang)
67 shlibpath
= os
.path
.pathsep
.join(
71 config
.environment
.get(shlibpath_var
, ""),
74 config
.environment
[shlibpath_var
] = shlibpath
78 "unable to inject shared library path on '{}'".format(platform
.system())
81 # It is not realistically possible to account for all options that could
82 # possibly be present in system and user configuration files, so disable
83 # default configs for the test runs.
84 config
.environment
["CLANG_NO_DEFAULT_CONFIG"] = "1"