2013-04-03 23:11:08 +08:00
|
|
|
# -*- Python -*-
|
|
|
|
|
2013-08-10 02:49:22 +08:00
|
|
|
import lit.formats
|
|
|
|
|
2013-04-03 23:11:08 +08:00
|
|
|
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:
|
2013-05-03 03:02:02 +08:00
|
|
|
config.test_source_root = extra_tools_obj_dir
|
2013-04-03 23:11:08 +08:00
|
|
|
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.
|
2013-08-10 02:49:22 +08:00
|
|
|
site_cfg = lit_config.params.get('extra_tools_unit_site_config', None)
|
2013-04-03 23:11:08 +08:00
|
|
|
if site_cfg and os.path.exists(site_cfg):
|
2013-08-10 02:49:22 +08:00
|
|
|
lit_config.load_config(config, site_cfg)
|
2013-04-03 23:11:08 +08:00
|
|
|
raise SystemExit
|
|
|
|
|
|
|
|
# FIXME: Support out-of-tree builds? See clang/test/Unit/lit.cfg if we care.
|