In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/10225cc45e84565b4226e605f73f8853179cf2a4?hp=b439bde545360bca281cee772516180c2bc86327>
- Log ----------------------------------------------------------------- commit 10225cc45e84565b4226e605f73f8853179cf2a4 Author: Karl Williamson <[email protected]> Date: Tue May 13 20:55:09 2014 -0600 run/locale.t: Add explanation for when tests fail Commit ff4377fe256e32a3bc10175c01dd6c68c9ce7ddb silenced some irrelevant warnings that occur from some sh programs on some systems. It does this by closing STDERR. That is fine unless the test fails. This commit changes things so that a failure now outputs a diagnostic note about how to see the test failure details. It would be better to automaticallty rerun the test with STDERR open when this happens, but that is more effort than it's worth IMO, given the likely rarity of the failures here. M t/run/locale.t commit 68021d02ea9fac414986d2a4edb9f9adc0ca4f53 Author: Karl Williamson <[email protected]> Date: Tue May 13 20:53:11 2014 -0600 run/locale.t: Remove redundant block This has { { foo } } Only one level is necessary. outdents. M t/run/locale.t ----------------------------------------------------------------------- Summary of changes: t/run/locale.t | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/t/run/locale.t b/t/run/locale.t index 0c58a63..6301734 100644 --- a/t/run/locale.t +++ b/t/run/locale.t @@ -215,7 +215,7 @@ EOF local $ENV{LANG} = $different; # Can't turn off the warnings, so send them to /dev/null - fresh_perl_is(<<"EOF", "$difference", { stderr => "devnull" }, + if (! fresh_perl_is(<<"EOF", "$difference", { stderr => "devnull" }, if (\$ENV{LC_ALL} ne "invalid") { # Make the test pass if the sh didn't accept the ENV set print "$difference\n"; @@ -227,7 +227,10 @@ EOF my \$in = 4.2; printf("%g", \$in); EOF - "LANG is used if LC_ALL, LC_NUMERIC are invalid"); + "LANG is used if LC_ALL, LC_NUMERIC are invalid")) + { + note "To see details change this .t to not close STDERR"; + } } SKIP: { @@ -236,24 +239,25 @@ EOF 1); } else { - { - local $ENV{LC_ALL} = "invalid"; - local $ENV{LC_NUMERIC} = "invalid"; - local $ENV{LANG} = "invalid"; - - # Can't turn off the warnings, so send them to /dev/null - fresh_perl_is(<<"EOF", 4.2, { stderr => "devnull" }, - if (\$ENV{LC_ALL} ne "invalid") { - print "$difference\n"; - exit 0; - } - use locale; - use POSIX qw(locale_h); - setlocale(LC_NUMERIC, ""); - my \$in = 4.2; - printf("%g", \$in); + local $ENV{LC_ALL} = "invalid"; + local $ENV{LC_NUMERIC} = "invalid"; + local $ENV{LANG} = "invalid"; + + # Can't turn off the warnings, so send them to /dev/null + if (! fresh_perl_is(<<"EOF", 4.2, { stderr => "devnull" }, + if (\$ENV{LC_ALL} ne "invalid") { + print "$difference\n"; + exit 0; + } + use locale; + use POSIX qw(locale_h); + setlocale(LC_NUMERIC, ""); + my \$in = 4.2; + printf("%g", \$in); EOF - 'C locale is used if LC_ALL, LC_NUMERIC, LANG are invalid'); + 'C locale is used if LC_ALL, LC_NUMERIC, LANG are invalid')) + { + note "To see details change this .t to not close STDERR"; } } } -- Perl5 Master Repository
