Add locales to available_features for tests.

Linux has a lot of failures caused by not having support for certain
locales. Since these come out as a lot of noise in the test results,
have lit.cfg detect the presence of the various locales used in the
tests and add them to config.available_features as locale.LOCALE_NAME.

This patch also adds REQUIRES: locale.REQUIRED_LOCALE to every test that
I saw failing in this manner. We probably need to add more for all the
tests requiring en_US.UTF-8, but we can do that on an as-needed basis.

One thing that concerns me is how many tests get skipped because of
missing locales (especially in regex/). We should make a point of
splitting up any tests that test default behavior _and_ behavior under a
given locale so that we aren't losing coverage for default behavior.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214753 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Albert 2014-08-04 18:44:48 +00:00
parent f0f1bca861
commit b4ed5ca01e
58 changed files with 233 additions and 0 deletions

View File

@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// <ios>
// template <class charT, class traits> class basic_ios

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.fr_FR.UTF-8
// <ios>
// template <class charT, class traits> class basic_ios

View File

@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// <ios>
// template <class charT, class traits> class basic_ios

View File

@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// <streambuf>
// template <class charT, class traits = char_traits<charT> >

View File

@ -3,6 +3,7 @@
# Configuration file for the 'lit' test runner.
import errno
import locale
import os
import platform
import re
@ -175,6 +176,42 @@ config.suffixes = ['.cpp']
# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)
# Figure out which of the required locales we support
locales = {
'Darwin': {
'en_US.UTF-8': 'en_US.UTF-8',
'cs_CZ.ISO8859-2': 'cs_CZ.ISO8859-2',
'fr_FR.UTF-8': 'fr_FR.UTF-8',
'fr_CA.ISO8859-1': 'cs_CZ.ISO8859-1',
'ru_RU.UTF-8': 'ru_RU.UTF-8',
'zh_CN.UTF-8': 'zh_CN.UTF-8',
},
'Linux': {
'en_US.UTF-8': 'en_US.UTF-8',
'cs_CZ.ISO8859-2': 'cs_CZ.ISO-8859-2',
'fr_FR.UTF-8': 'fr_FR.UTF-8',
'fr_CA.ISO8859-1': 'fr_CA.ISO-8859-1',
'ru_RU.UTF-8': 'ru_RU.UTF-8',
'zh_CN.UTF-8': 'zh_CN.UTF-8',
},
'Windows': {
'en_US.UTF-8': 'English_United States.1252',
'cs_CZ.ISO8859-2': 'Czech_Czech Republic.1250',
'fr_FR.UTF-8': 'French_France.1252',
'fr_CA.ISO8859-1': 'French_Canada.1252',
'ru_RU.UTF-8': 'Russian_Russia.1251',
'zh_CN.UTF-8': 'Chinese_China.936',
},
}
for feature, loc in locales[platform.system()].items():
try:
locale.setlocale(locale.LC_ALL, loc)
config.available_features.add('locale.{}'.format(feature))
except:
lit_config.warning('The locale {} is not supported by your platoform. '
'Some tests will be unsupported.'.format(loc))
# Gather various compiler parameters.
cxx_under_test = lit_config.params.get('cxx_under_test', None)
if cxx_under_test is None:

View File

@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_CA.UTF-8
// <locale>
// template <class charT> class ctype_byname;

View File

@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_CA.UTF-8
// <locale>
// template <class charT> class ctype_byname;

View File

@ -9,6 +9,8 @@
//
// XFAIL: apple-darwin
// REQUIRES: locale.fr_FR.UTF-8
// <locale>
// class money_get<charT, InputIterator>

View File

@ -9,6 +9,8 @@
//
// XFAIL: apple-darwin
// REQUIRES: locale.ru_RU.UTF-8
// <locale>
// class money_get<charT, InputIterator>

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class money_get<charT, InputIterator>

View File

@ -9,6 +9,8 @@
//
// XFAIL: apple-darwin
// REQUIRES: locale.fr_FR.UTF-8
// <locale>
// class money_put<charT, OutputIterator>

View File

@ -9,6 +9,8 @@
//
// XFAIL: apple-darwin
// REQUIRES: locale.ru_RU.UTF-8
// <locale>
// class money_put<charT, OutputIterator>

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class money_put<charT, OutputIterator>

View File

@ -9,6 +9,11 @@
//
// XFAIL: apple-darwin
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class moneypunct_byname<charT, International>

View File

@ -9,6 +9,11 @@
// <locale>
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// class moneypunct_byname<charT, International>
// charT decimal_point() const;

View File

@ -9,6 +9,11 @@
// <locale>
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// class moneypunct_byname<charT, International>
// int frac_digits() const;

View File

@ -9,6 +9,11 @@
//
// XFAIL: apple-darwin
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class moneypunct_byname<charT, International>

View File

@ -9,6 +9,11 @@
//
// XFAIL: apple-darwin
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class moneypunct_byname<charT, International>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class moneypunct_byname<charT, International>

View File

@ -9,6 +9,11 @@
//
// XFAIL: apple-darwin
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class moneypunct_byname<charT, International>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class moneypunct_byname<charT, International>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class moneypunct_byname<charT, International>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class time_get_byname<charT, InputIterator>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class time_get_byname<charT, InputIterator>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class time_get_byname<charT, InputIterator>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class time_get_byname<charT, InputIterator>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class time_get_byname<charT, InputIterator>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class time_get_byname<charT, InputIterator>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class time_get_byname<charT, InputIterator>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class time_get_byname<charT, InputIterator>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class time_get_byname<charT, InputIterator>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class time_get_byname<charT, InputIterator>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class time_get_byname<charT, InputIterator>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class time_get_byname<charT, InputIterator>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class time_get_byname<charT, InputIterator>

View File

@ -7,6 +7,11 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// class time_get_byname<charT, InputIterator>

View File

@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// <locale>
// template <class CharT, class OutputIterator = ostreambuf_iterator<CharT> >

View File

@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// <locale>
// template <class charT> class numpunct_byname;

View File

@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// <locale>
// template <class charT> class numpunct_byname;

View File

@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
// <locale>
// template <class charT> class numpunct_byname;

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.ru_RU.UTF-8
// <locale>
// const locale& operator=(const locale& other) throw();

View File

@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// explicit locale(const char* std_name);

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.fr_FR.UTF-8
// <locale>
// locale(const locale& other) throw();

View File

@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// <locale>
// locale(const locale& other, const char* std_name, category);

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.ru_RU.UTF-8
// <locale>
// template <class Facet> locale(const locale& other, Facet* f);

View File

@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// <locale>
// locale(const locale& other, const locale& one, category cats);

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.ru_RU.UTF-8
// <locale>
// locale(const locale& other, const string& std_name, category cat);

View File

@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// <locale>
// explicit locale(const string& std_name);

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.cs_CZ.ISO8859-2
// <regex>
// template <class BidirectionalIterator, class Allocator, class charT, class traits>

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.cs_CZ.ISO8859-2
// <regex>
// template <class BidirectionalIterator, class Allocator, class charT, class traits>

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.cs_CZ.ISO8859-2
// <regex>
// template <class BidirectionalIterator, class Allocator, class charT, class traits>

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.cs_CZ.ISO8859-2
// <regex>
// template <class BidirectionalIterator, class Allocator, class charT, class traits>

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.cs_CZ.ISO8859-2
// <regex>
// template <class BidirectionalIterator, class Allocator, class charT, class traits>

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.cs_CZ.ISO8859-2
// <regex>
// template <class BidirectionalIterator, class Allocator, class charT, class traits>

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.cs_CZ.ISO8859-2
// <regex>
// template <class BidirectionalIterator, class Allocator, class charT, class traits>

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.cs_CZ.ISO8859-2
// <regex>
// template <class charT> struct regex_traits;

View File

@ -8,6 +8,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.cs_CZ.ISO8859-2
// <regex>
// template <class charT> struct regex_traits;

View File

@ -8,6 +8,8 @@
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.cs_CZ.ISO8859-2
// <regex>
// template <class charT> struct regex_traits;