| 1 |
# -*- Python -*- |
| 2 |
|
| 3 |
import platform |
| 4 |
|
| 5 |
import lit.formats |
| 6 |
|
| 7 |
config.name = "Extra Tools Unit Tests" |
| 8 |
config.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 |
|
| 13 |
config.test_source_root = config.extra_tools_obj_dir |
| 14 |
config.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). |
| 20 |
config.test_format = lit.formats.GoogleTest(".", "Tests") |
| 21 |
|
| 22 |
if platform.system() == "Darwin": |
| 23 |
shlibpath_var = "DYLD_LIBRARY_PATH" |
| 24 |
elif platform.system() == "Windows": |
| 25 |
shlibpath_var = "PATH" |
| 26 |
else: |
| 27 |
shlibpath_var = "LD_LIBRARY_PATH" |
| 28 |
|
| 29 |
# Point the dynamic loader at dynamic libraries in 'lib'. |
| 30 |
shlibpath = os.path.pathsep.join( |
| 31 |
(config.shlibdir, config.llvm_libs_dir, config.environment.get(shlibpath_var, "")) |
| 32 |
) |
| 33 |
|
| 34 |
# Win32 seeks DLLs along %PATH%. |
| 35 |
if sys.platform in ["win32", "cygwin"] and os.path.isdir(config.shlibdir): |
| 36 |
shlibpath = os.path.pathsep.join((config.shlibdir, shlibpath)) |
| 37 |
|
| 38 |
config.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. |
| 43 |
config.environment["CLANG_NO_DEFAULT_CONFIG"] = "1" |