I've been a little despondent about the lib/locale.t failures ever since I became aware of them a few days ago.
But, tonight, I think I've found the correct way to deal with them.
Under make test there seems to be only the one failing test in lib/locale.t, but there's an additional 4 tests that fail if one runs ./perl -I./lib -T locale.t
There's no problem with those 5 tests on quadmath builds, irrespective of locale ... why is that ? ... it's because they're skipped on quadmath builds.
It then dawned upon me that if it's ok for quadmath builds to skip those tests, then it's ok for my patched approach to also skip them. (Like the quadmath builds, my approach also assigns NVs using the underlying C compiler via Perl_strtod.)
Having just modified lib/locale.t to skip those tests whenever Perl_strtod is defined, I find that all tests now pass !!
I just need to provide patches against current blead, and hope that I can get Karl and/or Jim to create another smoke-me branch for more testing.
If I can just get those patches into blead .....
Cheers, Rob
| [reply] [Watch: Dir/Any] [d/l] [select] |
It then dawned upon me that if it's ok for quadmath builds to skip those tests, then it's ok for my patched approach to also skip them
However, quadmath's inability to pass those tests didn't change any pre-existing behaviour, whereas my patches have changed behaviour - and that might not be greeted so warmly.
I probably ought at least find out exactly what that change of behaviour is - though it's as clear as mud to me at the moment.
It would be great if anyone has some clear code that demonstrates what has actually changed.
In the meantime, it's back to perusing the perllocale docs and lib/locale.t. (Is there some other documentation that might be helpful to me ?)
Cheers, Rob
| [reply] [Watch: Dir/Any] |
I probably ought at least find out exactly what that change of behaviour is
Here's the script that demonstrates that change of behaviour:
use warnings;
use locale;
$m = "3.14e+9" + 0;
$n = "3,14e+9" + 0;
print "\$m is $m\n";
print "\$n is $n\n";
On current bleadperl (and recent "double" and "long double" perls) it outputs:
$m is 3140000000
$n is 3140000000
But when I patch bleadperl to assign with Perl_strtod (or run that script on a quadmath build of perl) it outputs:
$m is 3140000000
$n is 3
AFAICT, it pertains solely to the numification of strings. When values are assigned as barewords, there's no difference between the behaviour of the various builds.
And I think it comes into play only if the locale radix character is a comma.
My next step is to find out whether this needs to be fixed before my proposed patches can be applied.
Cheers, Rob | [reply] [Watch: Dir/Any] [d/l] [select] |
Failed 2 tests out of 2458, 99.92% okay.
../ext/POSIX/t/posix.t
run/locale.t
But that's not too mysterious:
In particular, with those patches:
all tests pass.
| [reply] [Watch: Dir/Any] [d/l] [select] |
--- git/bleadperl/lib/locale.t 2018-07-15 10:33:46 +1000
+++ locale.t 2018-07-29 22:21:25 +1000
@@ -2167,8 +2167,8 @@
my $first_c_test = $locales_test_number;
$test_names{++$locales_test_number} = 'Verify that a different lo
+cale radix works when doing "==" with a constant';
- if ($Config{usequadmath}) {
- print "# Skip: no locale radix with usequadmath ($test_names{
+$locales_test_number})\n";
+ if ($Config{usequadmath} || ($Config{uselongdouble} && $Config{d_
+strtold}) || (!$Config{uselongdouble} && $Config{d_strtod})) {
+ print "# Skip: no locale radix with Perl_strtod ($test_names{
+$locales_test_number})\n";
report_result($Locale, $locales_test_number, 1);
} else {
report_result($Locale, $locales_test_number, $ok3);
@@ -2176,8 +2176,8 @@
}
$test_names{++$locales_test_number} = 'Verify that a different lo
+cale radix works when doing "==" with a scalar';
- if ($Config{usequadmath}) {
- print "# Skip: no locale radix with usequadmath ($test_names{
+$locales_test_number})\n";
+ if ($Config{usequadmath} || ($Config{uselongdouble} && $Config{d_
+strtold}) || (!$Config{uselongdouble} && $Config{d_strtod})) {
+ print "# Skip: no locale radix with Perl_strtod ($test_names{
+$locales_test_number})\n";
report_result($Locale, $locales_test_number, 1);
} else {
report_result($Locale, $locales_test_number, $ok4);
@@ -2198,8 +2198,8 @@
$test_names{$locales_test_number} = 'Verify that "==" with a scal
+ar still works in inner no locale';
$test_names{++$locales_test_number} = 'Verify that "==" with a sc
+alar and an intervening sprintf still works in inner no locale';
- if ($Config{usequadmath}) {
- print "# Skip: no locale radix with usequadmath ($test_names{
+$locales_test_number})\n";
+ if ($Config{usequadmath} || ($Config{uselongdouble} && $Config{d_
+strtold}) || (!$Config{uselongdouble} && $Config{d_strtod})) {
+ print "# Skip: no locale radix with Perl_strtod ($test_names{
+$locales_test_number})\n";
report_result($Locale, $locales_test_number, 1);
} else {
report_result($Locale, $locales_test_number, $ok8);
@@ -2218,8 +2218,8 @@
$problematical_tests{$locales_test_number} = 1;
$test_names{++$locales_test_number} = 'Verify that after a no-loc
+ale block, a different locale radix still works when doing "==" with
+a scalar and an intervening sprintf';
- if ($Config{usequadmath}) {
- print "# Skip: no locale radix with usequadmath ($test_names{
+$locales_test_number})\n";
+ if ($Config{usequadmath} || ($Config{uselongdouble} && $Config{d_
+strtold}) || (!$Config{uselongdouble} && $Config{d_strtod})) {
+ print "# Skip: no locale radix with Perl_strtod ($test_names{
+$locales_test_number})\n";
report_result($Locale, $locales_test_number, 1);
} else {
report_result($Locale, $locales_test_number, $ok11);
@@ -2465,8 +2465,8 @@
}
}
- if ($Config{usequadmath}) {
- print "# Skip: no locale radix with usequadmath ($Locale)
+\n";
+ if ($Config{usequadmath} || ($Config{uselongdouble} && $Confi
+g{d_strtold}) || (!$Config{uselongdouble} && $Config{d_strtod})) {
+ print "# Skip: no locale radix with Perl_strtod ($Locale)
+\n";
report_result($Locale, $locales_test_number, 1);
} else {
report_result($Locale, $locales_test_number, @f == 0);
(Safest to avoid line wrapping by electing to "download")
If you apply that patch to the lib/locale.t that shipped with blead_patched.tar.gz then all tests should (hopefully) pass.
Thanks again for the help you've provided. I much appreciate it.
Cheers, Rob | [reply] [Watch: Dir/Any] [d/l] [select] |
UPDATE: Patches for t/run/locale.t and ext/POSIX/t/posix.t have been submitted to perlbug - see https://rt.perl.org/Ticket/Display.html?id=133417
UPDATE 2: Those patches to t/run/locale.t and ext/POSIX/t/posix.t have now been applied to bleadperl.
Oh ... I failed to specifically thank you for providing those 2 patches.
I'll certainly be including them as I think that -Ud_strtod builds should be supported.
With current perl source there's no point in building with -Ud_strtod (or -Ud_strtold) but with the patches I'm proposing, those switches provide the simplest way to resort to using perl's Atof for assigning floating point values.
I don't expect that anyone in their right mind would want to opt for using perl's Atof, but I think the option should remain and the test suite should pass all tests.
Cheers, Rob
| [reply] [Watch: Dir/Any] |