features.py
: Recognize the 'Czech_Czechia.1250'
locale by StephanTLavavej · Pull Request #5480 · microsoft/STL (original) (raw)
Noticed by @muellerj2 in #5444 (comment). Windows 11 24H2 recognizes the locale name 'Czech_Czechia.1250'
and doesn't recognize 'Czech_Czech Republic.1250'
. I wasn't able to figure out when this change happened in Windows (a moderate amount of searching turned up nothing, and I even tried GitHub Copilot but it neither provided consistent answers nor cited any authoritative sources I could confirm), but it seems to have happened a while ago. (Presumably after our Python-powered test harness was added in 2020.)
We can assume/require that contributors and maintainers are running modern builds of Win11, and our CI infrastructure is now using Windows Server 2025, so we should switch to looking for the new locale name here. I believe our MSVC-internal infrastructure isn't using Server 2025 yet, but it doesn't use the Python-powered test harness, so this is irrelevant for it. (It doesn't even understand "REQUIRES" lines.)
Additionally, I have a logic cleanup to simplify how we add locale features. This just uses an if-statement instead of a when-lambda. It also uses a formatted string literal for clarity.
To validate this, I ran the test directories that require the cs_CZ.ISO8859-2
locale:
python tests\utils\stl-lit\stl-lit.py -o testing_x64.log -Dnotags=ASAN --order=random %STL%\llvm-project\libcxx\test\std\re\re.traits %STL%\llvm-project\libcxx\test\std\re\re.alg\re.alg.search %STL%\llvm-project\libcxx\test\std\re\re.alg\re.alg.match
There are 132 total discovered tests here. I then compared main
, #5444, this PR, and #5444 merged with this PR:
Result | main | #5444 | This PR | Both PRs |
---|---|---|---|---|
Skipped | 44 | 44 | 44 | 44 |
Unsupported | 22 | 22 | 0 | 0 |
Passed | 46 | 46 | 48 | 50 |
Expectedly Failed | 20 | 20 | 40 | 38 |