* The `platform` parameter controls the deployment target. For example lit can
be invoked with `--param=platform=macosx10.12`. Default is the current host.
-* The `use_system_cxx_lib` parameter indicates to use another library than the
- just built one. Invoking lit with `--param=use_system_cxx_lib=true` will run
- the test-suite against the host system library. Alternatively a path to the
- directory containing a specific prebuilt libc++ can be used, for example:
- `--param=use_system_cxx_lib=/path/to/macOS/10.12/`.
+* The `use_system_cxx_lib` parameter indicates that the test suite is being run
+ against a system library.
Tests can be marked as XFAIL based on multiple features made available by lit:
-
* if `--param=platform=macosx10.12` is passed, the following features will be available:
- availability=macosx
.. option:: cxx_library_root=<path/to/lib/>
Specify the directory of the libc++ library to be tested. By default the
- library folder of the build directory is used. This option cannot be used
- when use_system_cxx_lib is provided.
+ library folder of the build directory is used.
.. option:: cxx_runtime_root=<path/to/lib/>
**Default**: False
Enable or disable testing against the installed version of libc++ library.
- Note: This does not use the installed headers.
+ This impacts whether the ``with_system_cxx_lib`` Lit feature is defined or
+ not. The ``cxx_library_root`` and ``cxx_runtime_root`` parameters should
+ still be used to specify the path of the library to link to and run against,
+ respectively.
.. option:: use_lit_shell=<bool>
self.debug_build = self.get_lit_bool('debug_build', default=False)
self.exec_env = dict()
self.use_target = False
- self.use_system_cxx_lib = False
+ self.use_system_cxx_lib = self.get_lit_bool('use_system_cxx_lib', False)
self.use_clang_verify = False
self.long_tests = None
def configure(self):
self.configure_target_info()
self.configure_executor()
- self.configure_use_system_cxx_lib()
self.configure_cxx()
self.configure_triple()
self.configure_deployment()
else:
self.libcxx_obj_root = self.project_obj_root
- def configure_use_system_cxx_lib(self):
- # This test suite supports testing against either the system library or
- # the locally built one; the former mode is useful for testing ABI
- # compatibility between the current headers and a shipping dynamic
- # library.
- # Default to testing against the locally built libc++ library.
- self.use_system_cxx_lib = self.get_lit_conf('use_system_cxx_lib')
- if self.use_system_cxx_lib == 'true':
- self.use_system_cxx_lib = True
- elif self.use_system_cxx_lib == 'false':
- self.use_system_cxx_lib = False
- elif self.use_system_cxx_lib:
- assert os.path.isdir(self.use_system_cxx_lib), "the specified use_system_cxx_lib parameter (%s) is not a valid directory" % self.use_system_cxx_lib
- self.use_system_cxx_lib = os.path.abspath(self.use_system_cxx_lib)
- self.lit_config.note(
- "inferred use_system_cxx_lib as: %r" % self.use_system_cxx_lib)
-
def configure_cxx_stdlib_under_test(self):
self.cxx_stdlib_under_test = self.get_lit_conf(
'cxx_stdlib_under_test', 'libc++')
self.cxx.link_flags += shlex.split(link_flags_str)
def configure_link_flags_cxx_library_path(self):
- if not self.use_system_cxx_lib:
- if self.cxx_library_root:
- self.cxx.link_flags += ['-L' + self.cxx_library_root]
- if self.target_info.is_windows() and self.link_shared:
- self.add_path(self.cxx.compile_env, self.cxx_library_root)
- if self.cxx_runtime_root:
- if not self.target_info.is_windows():
- self.cxx.link_flags += ['-Wl,-rpath,' +
- self.cxx_runtime_root]
- elif self.target_info.is_windows() and self.link_shared:
- self.add_path(self.exec_env, self.cxx_runtime_root)
- elif os.path.isdir(str(self.use_system_cxx_lib)):
- self.cxx.link_flags += ['-L' + self.use_system_cxx_lib]
+ if self.cxx_library_root:
+ self.cxx.link_flags += ['-L' + self.cxx_library_root]
+ if self.target_info.is_windows() and self.link_shared:
+ self.add_path(self.cxx.compile_env, self.cxx_library_root)
+ if self.cxx_runtime_root:
if not self.target_info.is_windows():
self.cxx.link_flags += ['-Wl,-rpath,' +
- self.use_system_cxx_lib]
- if self.target_info.is_windows() and self.link_shared:
- self.add_path(self.cxx.compile_env, self.use_system_cxx_lib)
+ self.cxx_runtime_root]
+ elif self.target_info.is_windows() and self.link_shared:
+ self.add_path(self.exec_env, self.cxx_runtime_root)
additional_flags = self.get_lit_conf('test_linker_flags')
if additional_flags:
self.cxx.link_flags += shlex.split(additional_flags)