Skip to content

Commit

Permalink
[libc++] Split features for platform detection into its own function
Browse files Browse the repository at this point in the history
This will allow refactoring how the locales are figured out more easily.
  • Loading branch information
ldionne committed Apr 17, 2020
1 parent fde2aef commit 7d4546e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 2 additions & 4 deletions libcxx/utils/libcxx/test/config.py
Expand Up @@ -355,8 +355,6 @@ def configure_features(self):
self.config.available_features.add(f.strip())
self.target_info.add_locale_features(self.config.available_features)

target_platform = self.target_info.platform()

# Write an "available feature" that combines the triple when
# use_system_cxx_lib is enabled. This is so that we can easily write
# XFAIL markers for tests that are known to fail with versions of
Expand All @@ -379,8 +377,8 @@ def configure_features(self):
self.config.available_features.add('availability=%s' % name)
self.config.available_features.add('availability=%s%s' % (name, version))

# Insert the platform name into the available features as a lower case.
self.config.available_features.add(target_platform)
# Insert the platform name and version into the available features.
self.target_info.add_platform_features(self.config.available_features)

# 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
Expand Down
7 changes: 7 additions & 0 deletions libcxx/utils/libcxx/test/target_info.py
Expand Up @@ -40,6 +40,9 @@ def configure_env(self, env): pass
def allow_cxxabi_link(self): return True
def use_lit_shell_default(self): return False

def add_platform_features(self, features):
features.add(self.platform())

def add_path(self, dest_env, new_path):
if not new_path:
return
Expand Down Expand Up @@ -229,6 +232,10 @@ def platform_ver(self):

def add_locale_features(self, features):
self.add_common_locales(features)

def add_platform_features(self, features):
super(LinuxLocalTI, self).add_platform_features(features)

# Some linux distributions have different locale data than others.
# Insert the distributions name and name-version into the available
# features to allow tests to XFAIL on them.
Expand Down

0 comments on commit 7d4546e

Please sign in to comment.