xref: /llvm-project/clang-tools-extra/include-cleaner/test/Unit/lit.cfg.py (revision dd3c26a045c081620375a878159f536758baba6e)
1import lit.formats
2
3config.name = "clangIncludeCleaner Unit Tests"
4config.test_format = lit.formats.GoogleTest(".", "Tests")
5config.test_source_root = config.clang_include_cleaner_binary_dir + "/unittests"
6config.test_exec_root = config.clang_include_cleaner_binary_dir + "/unittests"
7
8# Point the dynamic loader at dynamic libraries in 'lib'.
9# FIXME: it seems every project has a copy of this logic. Move it somewhere.
10import platform
11
12if platform.system() == "Darwin":
13    shlibpath_var = "DYLD_LIBRARY_PATH"
14elif platform.system() == "Windows":
15    shlibpath_var = "PATH"
16else:
17    shlibpath_var = "LD_LIBRARY_PATH"
18config.environment[shlibpath_var] = os.path.pathsep.join(
19    ("@SHLIBDIR@", "@LLVM_LIBS_DIR@", config.environment.get(shlibpath_var, ""))
20)
21
22# It is not realistically possible to account for all options that could
23# possibly be present in system and user configuration files, so disable
24# default configs for the test runs.
25config.environment["CLANG_NO_DEFAULT_CONFIG"] = "1"
26