xref: /llvm-project/clang-tools-extra/test/Unit/lit.cfg.py (revision dd3c26a045c081620375a878159f536758baba6e)
1# -*- Python -*-
2
3import platform
4
5import lit.formats
6
7config.name = "Extra Tools Unit Tests"
8config.suffixes = []  # Seems not to matter for google tests?
9
10# Test Source and Exec root dirs both point to the same directory where google
11# test binaries are built.
12
13config.test_source_root = config.extra_tools_obj_dir
14config.test_exec_root = config.test_source_root
15
16# All GoogleTests are named to have 'Tests' as their suffix. The '.' option is
17# a special value for GoogleTest indicating that it should look through the
18# entire testsuite recursively for tests (alternatively, one could provide a
19# ;-separated list of subdirectories).
20config.test_format = lit.formats.GoogleTest(".", "Tests")
21
22if platform.system() == "Darwin":
23    shlibpath_var = "DYLD_LIBRARY_PATH"
24elif platform.system() == "Windows":
25    shlibpath_var = "PATH"
26else:
27    shlibpath_var = "LD_LIBRARY_PATH"
28
29# Point the dynamic loader at dynamic libraries in 'lib'.
30shlibpath = os.path.pathsep.join(
31    (config.shlibdir, config.llvm_libs_dir, config.environment.get(shlibpath_var, ""))
32)
33
34# Win32 seeks DLLs along %PATH%.
35if sys.platform in ["win32", "cygwin"] and os.path.isdir(config.shlibdir):
36    shlibpath = os.path.pathsep.join((config.shlibdir, shlibpath))
37
38config.environment[shlibpath_var] = shlibpath
39
40# It is not realistically possible to account for all options that could
41# possibly be present in system and user configuration files, so disable
42# default configs for the test runs.
43config.environment["CLANG_NO_DEFAULT_CONFIG"] = "1"
44