self.cxx = None
self.src_root = None
self.obj_root = None
+ self.library_root = None
self.env = {}
self.compile_flags = ['-nostdinc++']
self.link_flags = ['-nodefaultlibs']
self.configure_triple()
self.configure_src_root()
self.configure_obj_root()
+ self.configure_library_root()
self.configure_use_system_lib()
self.configure_use_clang_verify()
self.configure_ccache()
def configure_obj_root(self):
self.obj_root = self.get_lit_conf('libcxx_obj_root', self.src_root)
+ def configure_library_root(self):
+ self.library_root = self.get_lit_conf('libcxx_library_root', self.obj_root)
+
def configure_use_system_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
# Configure library search paths
abi_library_path = self.get_lit_conf('abi_library_path', '')
if not self.use_system_lib:
- self.link_flags += ['-L' + self.obj_root + '/lib']
- self.link_flags += ['-Wl,-rpath,' + self.obj_root + '/lib']
+ self.link_flags += ['-L' + self.library_root]
+ self.link_flags += ['-Wl,-rpath,' + self.library_root]
if abi_library_path:
self.link_flags += ['-L' + abi_library_path,
'-Wl,-rpath,' + abi_library_path]
def configure_env(self):
if sys.platform == 'darwin' and not self.use_system_lib:
- self.env['DYLD_LIBRARY_PATH'] = os.path.join(self.obj_root, 'lib')
+ self.env['DYLD_LIBRARY_PATH'] = self.library_root
# name: The name of this test suite.
config.name = 'libc++'
# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)
+# Infer the test_exec_root from the libcxx_object root.
+libcxx_obj_root = getattr(config, 'libcxx_obj_root', None)
+if libcxx_obj_root is not None:
+ config.test_exec_root = os.path.join(libcxx_obj_root, 'test')
+
+# Check that the test exec root is known.
+if config.test_exec_root is None:
+ # Otherwise, we haven't loaded the site specific configuration (the user is
+ # probably trying to run on a test file directly, and either the site
+ # configuration hasn't been created by the build system, or we are in an
+ # out-of-tree build situation).
+ site_cfg = lit_config.params.get('libcxx_site_config',
+ os.environ.get('LIBCXX_SITE_CONFIG'))
+ if not site_cfg:
+ lit_config.warning('No site specific configuration file found!'
+ ' Running the tests in the default configuration.')
+ # TODO: Set test_exec_root to a temporary directory where output files
+ # can be placed. This is needed for ShTest.
+ elif not os.path.isfile(site_cfg):
+ lit_config.fatal(
+ "Specified site configuration file does not exist: '%s'" %
+ site_cfg)
+ else:
+ lit_config.note('using site specific configuration at %s' % site_cfg)
+ lit_config.load_config(config, site_cfg)
+ raise SystemExit()
+
+
cfg_variant = getattr(config, 'configuration_variant', '')
if cfg_variant:
print 'Using configuration variant: %s' % cfg_variant