-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test1148: disable if decimal separator is not a point #2786
Conversation
There are a bunch of tests that set the environment in this way and they all
can't be fixed this way. And are you sure that , and . are the only two decimal
separator characters possible in any locale? It seems a better way to solve
this would be to detect environments where the environment can't be set like
this and skip the test, or skip the test if the environment requested is
different from the one actually currently set.
|
There are other decimal separators, but I couldn't find any others that are for Hindu-Arabic numerals. Good point, I have to test what happens with languages with other numeral systems. Removing How would you implement skipping such tests? Using |
I tried with locales This happens when building for native Windows (e.g. using MSVC or MinGW), but not when building for MSYS, so there's probably no good solution without running any code. |
A precheck would work. It would mean duplicating some of the information in the
<setenv> section, though, but it affects a small enough set of tests that it's
probably not worth building into the test harness.
|
b773d87
to
de7e7e9
Compare
Modifying the locale with environment variables doesn't work for native Windows applications. Just disable the test in this case if the decimal separator is something different than a point. Use a precheck with a small C program to achieve that. Closes curl#2786
That was fun! Something like this? Unfortunately, Perl is not my native language and this is the first time I touched an automake file, so I'm not sure if I got this right. But it does work - the test is skipped in my German MSYS2 MinGW shell, where it previously failed, but not in my German MSYS2 MSYS shell, where it succeeds. But, when I had I still have to update potential other tests setting |
Try adding |
de7e7e9
to
fd9d309
Compare
Modifying the locale with environment variables doesn't work for native Windows applications. Just disable the test in this case if the decimal separator is something different than a point. Use a precheck with a small C program to achieve that. Closes curl#2786
I would expect a <precheck> like this would work without the need for an
external C program:
perl -e 'use locale; die("Test requires locale support") if not sprintf("%f", 1.234) =~ /\./'
|
Thanks to both of you! I wasn't sure if there was a difference between perl and C. But if perl-only works, that's better. I'll make sure it generates the same result and update the PR accordingly. |
Unfortunately, that doesn't work because MSYS2's perl always respects |
fd9d309
to
02e0c8d
Compare
Modifying the locale with environment variables doesn't work for native Windows applications. Just disable the test in this case if the decimal separator is something different than a point. Use a precheck with a small C program to achieve that. Closes curl#2786
02e0c8d
to
571b161
Compare
Modifying the locale with environment variables doesn't work for native Windows applications. Just disable the test in this case if the decimal separator is something different than a point. Use a precheck with a small C program to achieve that. Closes curl#2786
Fixed the MSVC static CMake build, breaking the autotools build. Fixed that, breaking the Linux CMake build 😃 |
Modifying the locale with environment variables doesn't work for native Windows applications. Just disable the test in this case if the decimal separator is something different than a point. Use a precheck with a small C program to achieve that. Closes curl#2786
571b161
to
837c6c9
Compare
Finally all configurations are passing. I haven't found any other curl test setting |
Modifying the locale with environment variables doesn't work for native Windows applications. Just disable the test in this case if the decimal separator is something different than a point. Use a precheck with a small C program to achieve that. Closes curl#2786
Modifying the locale with environment variables doesn't work for native Windows applications. Just disable the test in this case if the decimal separator is something different than a point. Use a precheck with a small C program to achieve that. Closes curl#2786
LC_NUMERIC
doesn't work on Windows, so just replace the decimal commawith a decimal point in the expected result.