llvm-project/clang-tools-extra/test/Unit/lit.cfg

32 lines
1.3 KiB
Python

# -*- Python -*-
import lit.formats
config.name = "Extra Tools Unit Tests"
config.suffixes = [] # Seems not to matter for google tests?
# Test Source and Exec root dirs both point to the same directory where google
# test binaries are built.
extra_tools_obj_dir = getattr(config, 'extra_tools_obj_dir', None)
if extra_tools_obj_dir is not None:
config.test_source_root = extra_tools_obj_dir
config.test_exec_root = config.test_source_root
# All GoogleTests are named to have 'Tests' as their suffix. The '.' option is
# a special value for GoogleTest indicating that it should look through the
# entire testsuite recursively for tests (alternatively, one could provide a
# ;-separated list of subdirectories).
config.test_format = lit.formats.GoogleTest('.', 'Tests')
# If the site-specific configuration wasn't loaded (e.g. the build system failed
# to create it or the user is running a test file directly) try to come up with
# sane config options.
if config.test_exec_root is None:
# Look for a --param=extra_tools_unit_site_config option.
site_cfg = lit_config.params.get('extra_tools_unit_site_config', None)
if site_cfg and os.path.exists(site_cfg):
lit_config.load_config(config, site_cfg)
raise SystemExit
# FIXME: Support out-of-tree builds? See clang/test/Unit/lit.cfg if we care.