diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-08 17:13:34 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-08 17:13:34 +0000 |
commit | 733153a0fb52facba02c550ec849f0c734dfa412 (patch) | |
tree | 8f249e8b8f6a7803a81bb0fed33213b9249b7ac1 /utils/libcxx | |
parent | 2fa809d9eabddd820af54059faa8362dd50b51de (diff) |
Notes
Diffstat (limited to 'utils/libcxx')
-rw-r--r-- | utils/libcxx/test/config.py | 50 | ||||
-rw-r--r-- | utils/libcxx/test/target_info.py | 26 |
2 files changed, 57 insertions, 19 deletions
diff --git a/utils/libcxx/test/config.py b/utils/libcxx/test/config.py index f839a3a0985e9..7f1ae851b9ce6 100644 --- a/utils/libcxx/test/config.py +++ b/utils/libcxx/test/config.py @@ -123,6 +123,7 @@ class Configuration(object): self.configure_cxx() self.configure_triple() self.configure_deployment() + self.configure_availability() self.configure_src_root() self.configure_obj_root() self.configure_cxx_stdlib_under_test() @@ -285,6 +286,12 @@ class Configuration(object): self.lit_config.note( "inferred use_system_cxx_lib as: %r" % self.use_system_cxx_lib) + def configure_availability(self): + # See http://llvm.org/docs/AvailabilityMarkup.html + self.with_availability = self.get_lit_bool('with_availability', False) + self.lit_config.note( + "inferred with_availability as: %r" % self.with_availability) + def configure_cxx_stdlib_under_test(self): self.cxx_stdlib_under_test = self.get_lit_conf( 'cxx_stdlib_under_test', 'libc++') @@ -306,6 +313,9 @@ class Configuration(object): def configure_use_clang_verify(self): '''If set, run clang with -verify on failing tests.''' + if self.with_availability: + self.use_clang_verify = False + return self.use_clang_verify = self.get_lit_bool('use_clang_verify') if self.use_clang_verify is None: # NOTE: We do not test for the -verify flag directly because @@ -346,6 +356,12 @@ class Configuration(object): self.cxx.use_ccache = True self.lit_config.note('enabling ccache') + def add_deployment_feature(self, feature): + (arch, name, version) = self.config.deployment + self.config.available_features.add('%s=%s-%s' % (feature, arch, name)) + self.config.available_features.add('%s=%s' % (feature, name)) + self.config.available_features.add('%s=%s%s' % (feature, name, version)) + def configure_features(self): additional_features = self.get_lit_conf('additional_features') if additional_features: @@ -364,15 +380,31 @@ class Configuration(object): self.config.available_features.add( 'with_system_cxx_lib=%s' % self.config.target_triple) - # Insert the platform name into the available features as a lower case. - self.config.available_features.add(target_platform) + # Add subcomponents individually. + target_components = self.config.target_triple.split('-') + for component in target_components: + self.config.available_features.add( + 'with_system_cxx_lib=%s' % component) - # If we're using deployment, add sub-components of the triple using - # "darwin" instead of the platform name. - if self.use_deployment: - arch, _, _ = self.config.deployment + # Add available features for more generic versions of the target + # triple attached to with_system_cxx_lib. + if self.use_deployment: + self.add_deployment_feature('with_system_cxx_lib') + + # Configure the availability markup checks features. + if self.with_availability: + self.config.available_features.add('availability_markup') + self.add_deployment_feature('availability_markup') + + if self.use_system_cxx_lib or self.with_availability: + self.config.available_features.add('availability') + self.add_deployment_feature('availability') + + if platform.system() == 'Darwin': self.config.available_features.add('apple-darwin') - self.config.available_features.add(arch + '-apple-darwin') + + # Insert the platform name into the available features as a lower case. + self.config.available_features.add(target_platform) # Simulator testing can take a really long time for some of these tests # so add a feature check so we can REQUIRES: long_tests in them @@ -508,6 +540,10 @@ class Configuration(object): self.cxx.flags += ['-arch', arch] self.cxx.flags += ['-m' + name + '-version-min=' + version] + # Disable availability unless explicitely requested + if not self.with_availability: + self.cxx.flags += ['-D_LIBCPP_DISABLE_AVAILABILITY'] + def configure_compile_flags_header_includes(self): support_path = os.path.join(self.libcxx_src_root, 'test', 'support') if self.cxx_stdlib_under_test != 'libstdc++' and \ diff --git a/utils/libcxx/test/target_info.py b/utils/libcxx/test/target_info.py index 9a7ae05a0285c..2104432f03c0f 100644 --- a/utils/libcxx/test/target_info.py +++ b/utils/libcxx/test/target_info.py @@ -46,25 +46,26 @@ def test_locale(loc): locale.setlocale(locale.LC_ALL, default_locale) -def add_common_locales(features, lit_config): +def add_common_locales(features, lit_config, is_windows=False): # A list of locales needed by the test-suite. # The list uses the canonical name for the locale used in the test-suite # TODO: On Linux ISO8859 *may* needs to hyphenated. locales = [ - 'en_US.UTF-8', - 'fr_FR.UTF-8', - 'ru_RU.UTF-8', - 'zh_CN.UTF-8', - 'fr_CA.ISO8859-1', - 'cs_CZ.ISO8859-2' + ('en_US.UTF-8', 'English_United States.1252'), + ('fr_FR.UTF-8', 'French_France.1252'), + ('ru_RU.UTF-8', 'Russian_Russia.1251'), + ('zh_CN.UTF-8', 'Chinese_China.936'), + ('fr_CA.ISO8859-1', 'French_Canada.1252'), + ('cs_CZ.ISO8859-2', 'Czech_Czech Republic.1250') ] - for loc in locales: - if test_locale(loc): - features.add('locale.{0}'.format(loc)) + for loc_id, windows_loc_name in locales: + loc_name = windows_loc_name if is_windows else loc_id + if test_locale(loc_name): + features.add('locale.{0}'.format(loc_id)) else: lit_config.warning('The locale {0} is not supported by ' 'your platform. Some tests will be ' - 'unsupported.'.format(loc)) + 'unsupported.'.format(loc_name)) class DarwinLocalTI(DefaultTargetInfo): @@ -251,7 +252,8 @@ class WindowsLocalTI(DefaultTargetInfo): super(WindowsLocalTI, self).__init__(full_config) def add_locale_features(self, features): - add_common_locales(features, self.full_config.lit_config) + add_common_locales(features, self.full_config.lit_config, + is_windows=True) def use_lit_shell_default(self): # Default to the internal shell on Windows, as bash on Windows is |