diff options
author | Eric Fiselier <eric@efcs.ca> | 2017-05-08 02:09:48 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2017-05-08 02:09:48 +0000 |
commit | ca052ce73a56c9bf13ac1dd17e61ac294e6a4a78 (patch) | |
tree | 79b6037325f5014c57ef1f40bd2b686308cb5c47 /utils | |
parent | 720637d9f224ec4ddb5eeec832b45617300fa8b2 (diff) |
Fix Windows locale detection
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302396 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/libcxx/test/target_info.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/utils/libcxx/test/target_info.py b/utils/libcxx/test/target_info.py index 9a7ae05a0..2104432f0 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 |