mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-26 19:36:28 +00:00
b6355cc561
A year or so ago, I re-wrote most of the lit infrastructure in LLVM so that it wasn't so boilerplate-y. I added lots of common helper type stuff, simplifed usage patterns, and made the code more elegant and maintainable. We migrated to this in LLVM, clang, and lld's lit files, but not in LLDBs. This started to bite me recently, as the 4 most recent times I tried to run the lit test suite in LLDB on a fresh checkout the first thing that would happen is that python would just start crashing with unhelpful backtraces and I would have to spend time investigating. You can reproduce this today by doing a fresh cmake generation, doing ninja lldb and then python bin/llvm-lit.py -sv ~/lldb/lit/SymbolFile at which point you'll get a segfault that tells you nothing about what your problem is. I started trying to fix the issues with bandaids, but it became clear that the proper solution was to just bring in the work I did in the rest of the projects. The side benefit of this is that the lit configuration files become much cleaner and more understandable as a result. Differential Revision: https://reviews.llvm.org/D54009 llvm-svn: 346008
31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
# -*- Python -*-
|
|
|
|
# Configuration file for the 'lit' test runner.
|
|
|
|
import os
|
|
import sys
|
|
|
|
import lit.formats
|
|
from lit.llvm import llvm_config
|
|
|
|
# name: The name of this test suite.
|
|
config.name = 'lldb-Unit'
|
|
|
|
# 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
|
|
|
|
# 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.
|
|
llvm_config.with_system_environment('PATH')
|
|
llvm_config.with_environment('PATH', os.path.dirname(sys.executable), append_path=True)
|
|
|
|
# testFormat: The test format to use to interpret tests.
|
|
config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, 'Tests')
|