On Mon Aug 19 08:23:39 2013, SHAY wrote:
Show quoted text
Unfortunately, I had problems running the core perl test suite: the version tests were all running with the $Verbose flag set, causing lots of output which is not supposed to appear.
I think the problems are two-fold: Firstly, the scripts all declare a lexical variable called $Verbose, which will not be affected by the use of a (package variable) typeglob in coretests.pm in the way that was presumably intended. I've therefore changed "my $Verbose" to "our $Verbose" throughout (and removed it from one test script which didn't use it anyway).
Secondly, coretests.pm was assigning 0 to *Verbose rather than to $Verbose, which resulted in $0 getting assigned to $Verbose, which was not at all what was wanted: this is what caused the noisy output, since $0 tests as "true".
The changes are in this core commit:
http://perl5.git.perl.org/perl.git/commit/aed68192dd281f264ca1b61138be853d571f4340
These fixes, plus the changes I sent a couple of hours ago, are all in the new patch attached here. Please can you take a look and check that I've done this correctly, and roll a 0.9904 sometime if all looks well.
diff -ruN version-0.9903.orig/lib/version.pm version-0.9903/lib/version.pm
--- version-0.9903.orig/lib/version.pm 2013-08-18 14:57:32.000000000 +0100
+++ version-0.9903/lib/version.pm 2013-08-19 13:04:37.504983400 +0100
@@ -171,7 +171,7 @@
map { $args{$_} = 1 } @_
}
else { # no parameters at all on use line
- %args =
+ %args =
(
qv => 1,
'UNIVERSAL::VERSION' => 1,
diff -ruN version-0.9903.orig/t/01base.t version-0.9903/t/01base.t
--- version-0.9903.orig/t/01base.t 2013-08-15 12:15:38.000000000 +0100
+++ version-0.9903/t/01base.t 2013-08-19 15:21:48.550772300 +0100
@@ -5,7 +5,7 @@
#########################
use Test::More qw/no_plan/;
-my $Verbose;
+our $Verbose;
BEGIN {
(my $coretests = $0) =~ s'[^/]+\.t'coretests.pm';
diff -ruN version-0.9903.orig/t/02derived.t version-0.9903/t/02derived.t
--- version-0.9903.orig/t/02derived.t 2013-08-15 12:11:38.000000000 +0100
+++ version-0.9903/t/02derived.t 2013-08-19 15:26:40.236455800 +0100
@@ -6,7 +6,7 @@
use Test::More qw/no_plan/;
use File::Temp qw/tempfile/;
-my $Verbose;
+our $Verbose;
BEGIN {
(my $coretests = $0) =~ s'[^/]+\.t'coretests.pm';
diff -ruN version-0.9903.orig/t/03require.t version-0.9903/t/03require.t
--- version-0.9903.orig/t/03require.t 2013-08-15 12:11:38.000000000 +0100
+++ version-0.9903/t/03require.t 2013-08-19 15:26:50.268029500 +0100
@@ -5,7 +5,7 @@
#########################
use Test::More qw/no_plan/;
-my $Verbose;
+our $Verbose;
BEGIN {
(my $coretests = $0) =~ s'[^/]+\.t'coretests.pm';
diff -ruN version-0.9903.orig/t/04strict_lax.t version-0.9903/t/04strict_lax.t
--- version-0.9903.orig/t/04strict_lax.t 2013-08-15 12:11:38.000000000 +0100
+++ version-0.9903/t/04strict_lax.t 2013-08-19 15:27:34.915583200 +0100
@@ -5,7 +5,6 @@
#########################
use Test::More qw/no_plan/;
-my $Verbose;
# do strict lax tests in a sub to isolate a package to test importing
SKIP: {
diff -ruN version-0.9903.orig/t/07locale.t version-0.9903/t/07locale.t
--- version-0.9903.orig/t/07locale.t 2013-08-15 12:11:38.000000000 +0100
+++ version-0.9903/t/07locale.t 2013-08-19 15:27:25.252030500 +0100
@@ -7,17 +7,17 @@
use File::Basename;
use File::Temp qw/tempfile/;
use POSIX qw/locale_h/;
-use Test::More tests => 9;
+use Test::More tests => 7;
use Config;
-my $Verbose;
+our $Verbose;
BEGIN {
use_ok('version', 0.9903);
}
SKIP: {
- skip 'No locale testing for Perl < 5.6.0', 8 if $] < 5.006;
- skip 'No locale testing without d_setlocale', 8
+ skip 'No locale testing for Perl < 5.6.0', 6 if $] < 5.006;
+ skip 'No locale testing without d_setlocale', 6
if(!$Config{d_setlocale});
# test locale handling
@@ -39,26 +39,19 @@
$loc = setlocale( LC_ALL, $_);
last if localeconv()->{decimal_point} eq ',';
}
- skip 'Cannot test locale handling without a comma locale', 7
+ skip 'Cannot test locale handling without a comma locale', 5
unless $loc and localeconv()->{decimal_point} eq ',';
diag ("Testing locale handling with $loc") if $Verbose;
setlocale(LC_NUMERIC, $loc);
- ok ("$ver eq '1,23'", "Using locale: $loc");
+ ok ($ver eq "1,23", "Using locale: $loc");
$v = version->new($ver);
unlike($warning, qr/Version string '1,23' contains invalid data/,
"Process locale-dependent floating point");
ok ($v eq "1.23", "Locale doesn't apply to version objects");
ok ($v == $ver, "Comparison to locale floating point");
- {
- no locale;
- ok ("$ver eq '1.23'", "Outside of scope of use locale");
- }
- ok("\"$ver\"+1 gt 2.22" && \"$ver\"+1 lt 2.24",
- "Can do math when radix is not a dot"); # [perl 115800]
-
setlocale( LC_ALL, $orig_loc); # reset this before possible skip
skip 'Cannot test RT#46921 with Perl < 5.008', 1
if ($] < 5.008);
diff -ruN version-0.9903.orig/t/coretests.pm version-0.9903/t/coretests.pm
--- version-0.9903.orig/t/coretests.pm 2013-08-15 12:13:00.000000000 +0100
+++ version-0.9903/t/coretests.pm 2013-08-19 15:21:38.520198600 +0100
@@ -2,7 +2,7 @@
package main;
require Test::Harness;
*Verbose = \$Test::Harness::Verbose;
-*Verbose = 0 if $ENV{PERL_CORE};
+$Verbose = 0 if $ENV{PERL_CORE};
use Data::Dumper;
use File::Temp qw/tempfile/;
use File::Basename;