2015-03-13 20:55:07 +00:00
|
|
|
# -*- Python -*-
|
|
|
|
|
|
|
|
# Configuration file for the 'lit' test runner.
|
|
|
|
|
|
|
|
import os
|
2018-11-02 17:49:01 +00:00
|
|
|
import sys
|
2015-03-13 20:55:07 +00:00
|
|
|
|
|
|
|
import lit.formats
|
2018-11-02 17:49:01 +00:00
|
|
|
from lit.llvm import llvm_config
|
2015-03-13 20:55:07 +00:00
|
|
|
|
|
|
|
# name: The name of this test suite.
|
2019-10-09 19:22:02 +00:00
|
|
|
config.name = "lldb-unit"
|
2015-03-13 20:55:07 +00:00
|
|
|
|
|
|
|
# suffixes: A list of file extensions to treat as test files.
|
|
|
|
config.suffixes = []
|
|
|
|
|
|
|
|
# test_source_root: The root path where unit test binaries are located.
|
|
|
|
# test_exec_root: The root path where tests should be run.
|
|
|
|
config.test_source_root = os.path.join(config.lldb_obj_root, "unittests")
|
|
|
|
config.test_exec_root = config.test_source_root
|
|
|
|
|
2018-11-02 17:49:01 +00:00
|
|
|
# One of our unit tests dynamically links against python.dll, and on Windows
|
|
|
|
# it needs to be able to find it at runtime. This is fine if Python is on your
|
|
|
|
# system PATH, but if it's not, then this unit test executable will fail to run.
|
|
|
|
# We can solve this by forcing the Python directory onto the system path here.
|
2021-03-09 09:44:32 -08:00
|
|
|
llvm_config.with_system_environment(
|
|
|
|
[
|
|
|
|
"HOME",
|
|
|
|
"PATH",
|
|
|
|
"TEMP",
|
|
|
|
"TMP",
|
2021-03-09 09:49:33 -08:00
|
|
|
"XDG_CACHE_HOME",
|
2021-03-09 09:44:32 -08:00
|
|
|
]
|
|
|
|
)
|
|
|
|
llvm_config.with_environment("PATH", os.path.dirname(sys.executable), append_path=True)
|
2018-11-02 17:49:01 +00:00
|
|
|
|
2023-08-07 11:26:28 -07:00
|
|
|
# Enable sanitizer runtime flags.
|
2024-11-06 09:58:32 -08:00
|
|
|
if config.llvm_use_sanitizer:
|
|
|
|
config.environment["ASAN_OPTIONS"] = "detect_stack_use_after_return=1"
|
|
|
|
config.environment["TSAN_OPTIONS"] = "halt_on_error=1"
|
|
|
|
config.environment["MallocNanoZone"] = "0"
|
2023-08-07 11:26:28 -07:00
|
|
|
|
2015-03-13 20:55:07 +00:00
|
|
|
# testFormat: The test format to use to interpret tests.
|
|
|
|
config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, "Tests")
|