Front page | perl.perl5.porters |
Postings from July 2008
Test::Harness differences
Thread Next
From:
Nicholas Clark
Date:
July 31, 2008 14:32
Subject:
Test::Harness differences
Message ID:
20080731213217.GZ45868@plum.flirble.org
I've just done this:
Change 34169 by nicholas@mouse-mill on 2008/07/31 21:27:36
Upgrade to Test::Harness 3.13
...
I note the following difference in the modules:
diff -rpu ../Test-Harness-3.13/lib/TAP/Parser/Grammar.pm lib/TAP/Parser/Grammar.pm
--- ../Test-Harness-3.13/lib/TAP/Parser/Grammar.pm 2008-06-23 02:50:21.000000000 +0100
+++ lib/TAP/Parser/Grammar.pm 2008-07-31 20:58:17.000000000 +0100
@@ -149,7 +149,7 @@ my %language_for;
}
return $self->_make_test_token(
$line, $ok, $num, $desc,
- uc $dir, $explanation
+ $dir, $explanation
);
},
},
which appears to be half of change 33092:
Change 33092 by rgs@stcosmo on 2008/01/28 14:06:59
Warning cleanup, and avoid a double call to uc
Affected files ...
... //depot/perl/lib/TAP/Parser/Grammar.pm#4 edit
Differences ...
==== //depot/perl/lib/TAP/Parser/Grammar.pm#4 (text) ====
@@ -133,7 +133,7 @@
}
return $self->_make_test_token(
$line, $ok, $num, $desc,
- uc $dir, $explanation
+ $dir, $explanation
);
},
},
@@ -372,7 +372,7 @@
ok => $ok,
test_num => $num,
description => _trim($desc),
- directive => uc($dir),
+ directive => uc($dir || ""),
explanation => _trim($explanation),
raw => $line,
type => 'test',
I'm not sure how half of that got in, and half did not.
There are 2 differences in the tests. I had to make this change to get tests
passing:
diff -rpu ../Test-Harness-3.13/t/grammar.t lib/Test/Harness/t/grammar.t
--- ../Test-Harness-3.13/t/grammar.t 2008-06-10 02:21:11.000000000 +0100
+++ lib/Test/Harness/t/grammar.t 2008-07-31 21:47:32.000000000 +0100
@@ -1,7 +1,16 @@
#!/usr/bin/perl -w
use strict;
-use lib 't/lib';
+
+BEGIN {
+ if ( $ENV{PERL_CORE} ) {
+ chdir 't';
+ @INC = ( '../lib', 'lib' );
+ }
+ else {
+ unshift @INC, 't/lib';
+ }
+}
use Test::More tests => 94;
More troubling, it seems that t/compat/test-harness-compat.t is currently
skipped, and slowly diverging from the master. diff follows.
What should we do about this? Does anyone have time in the near future to look
at this and resolve the problem?
Nicholas Clark
diff -rpu ../Test-Harness-3.13/t/compat/test-harness-compat.t lib/Test/Harness/t/compat/test-harness-compat.t
--- ../Test-Harness-3.13/t/compat/test-harness-compat.t 2008-06-22 03:02:57.000000000 +0100
+++ lib/Test/Harness/t/compat/test-harness-compat.t 2008-07-31 21:04:45.000000000 +0100
@@ -1,34 +1,33 @@
#!/usr/bin/perl -w
BEGIN {
- if ( $ENV{PERL_CORE} ) {
- chdir 't';
- @INC = '../lib';
- }
- else {
- unshift @INC, 't/lib';
+ if ($ENV{PERL_CORE}) {
+ # FIXME
+ print "1..0 # Skip until we figure out why it exists with no output just after the plan\n";
+ exit 0;
}
}
use strict;
-# use lib 't/lib';
+use lib 't/lib';
use Test::More;
+
use File::Spec;
+
use Test::Harness qw(execute_tests);
# unset this global when self-testing ('testcover' and etc issue)
local $ENV{HARNESS_PERL_SWITCHES};
-my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sample-tests' : 't/sample-tests';
-
{
# if the harness wants to save the resulting TAP we shouldn't
# do it for our internal calls
local $ENV{PERL_TEST_HARNESS_DUMP_TAP} = 0;
+ my $TEST_DIR = 't/sample-tests';
my $PER_LOOP = 4;
my $results = {
@@ -59,110 +58,110 @@ my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sa
)
) => {
'failed' => {
- "$TEST_DIR/die" => {
+ 't/sample-tests/die' => {
'canon' => '??',
'estat' => 1,
'failed' => '??',
'max' => '??',
- 'name' => "$TEST_DIR/die",
+ 'name' => 't/sample-tests/die',
'wstat' => '256'
},
- "$TEST_DIR/die_head_end" => {
+ 't/sample-tests/die_head_end' => {
'canon' => '??',
'estat' => 1,
'failed' => '??',
'max' => '??',
- 'name' => "$TEST_DIR/die_head_end",
+ 'name' => 't/sample-tests/die_head_end',
'wstat' => '256'
},
- "$TEST_DIR/die_last_minute" => {
+ 't/sample-tests/die_last_minute' => {
'canon' => '??',
'estat' => 1,
'failed' => 0,
'max' => 4,
- 'name' => "$TEST_DIR/die_last_minute",
+ 'name' => 't/sample-tests/die_last_minute',
'wstat' => '256'
},
- "$TEST_DIR/duplicates" => {
+ 't/sample-tests/duplicates' => {
'canon' => '??',
'estat' => '',
'failed' => '??',
'max' => 10,
- 'name' => "$TEST_DIR/duplicates",
+ 'name' => 't/sample-tests/duplicates',
'wstat' => ''
},
- "$TEST_DIR/head_fail" => {
+ 't/sample-tests/head_fail' => {
'canon' => 2,
'estat' => '',
'failed' => 1,
'max' => 4,
- 'name' => "$TEST_DIR/head_fail",
+ 'name' => 't/sample-tests/head_fail',
'wstat' => ''
},
- "$TEST_DIR/inc_taint" => {
+ 't/sample-tests/inc_taint' => {
'canon' => 1,
'estat' => 1,
'failed' => 1,
'max' => 1,
- 'name' => "$TEST_DIR/inc_taint",
+ 'name' => 't/sample-tests/inc_taint',
'wstat' => '256'
},
- "$TEST_DIR/no_nums" => {
+ 't/sample-tests/no_nums' => {
'canon' => 3,
'estat' => '',
'failed' => 1,
'max' => 5,
- 'name' => "$TEST_DIR/no_nums",
+ 'name' => 't/sample-tests/no_nums',
'wstat' => ''
},
- "$TEST_DIR/no_output" => {
+ 't/sample-tests/no_output' => {
'canon' => '??',
'estat' => '',
'failed' => '??',
'max' => '??',
- 'name' => "$TEST_DIR/no_output",
+ 'name' => 't/sample-tests/no_output',
'wstat' => ''
},
- "$TEST_DIR/simple_fail" => {
+ 't/sample-tests/simple_fail' => {
'canon' => '2 5',
'estat' => '',
'failed' => 2,
'max' => 5,
- 'name' => "$TEST_DIR/simple_fail",
+ 'name' => 't/sample-tests/simple_fail',
'wstat' => ''
},
- "$TEST_DIR/todo_misparse" => {
+ 't/sample-tests/todo_misparse' => {
'canon' => 1,
'estat' => '',
'failed' => 1,
'max' => 1,
- 'name' => "$TEST_DIR/todo_misparse",
+ 'name' => 't/sample-tests/todo_misparse',
'wstat' => ''
},
- "$TEST_DIR/too_many" => {
+ 't/sample-tests/too_many' => {
'canon' => '4-7',
'estat' => 4,
'failed' => 4,
'max' => 3,
- 'name' => "$TEST_DIR/too_many",
+ 'name' => 't/sample-tests/too_many',
'wstat' => '1024'
},
- "$TEST_DIR/vms_nit" => {
+ 't/sample-tests/vms_nit' => {
'canon' => 1,
'estat' => '',
'failed' => 1,
'max' => 2,
- 'name' => "$TEST_DIR/vms_nit",
+ 'name' => 't/sample-tests/vms_nit',
'wstat' => ''
}
},
'todo' => {
- "$TEST_DIR/todo_inline" => {
+ 't/sample-tests/todo_inline' => {
'canon' => 2,
'estat' => '',
'failed' => 1,
'max' => 2,
- 'name' => "$TEST_DIR/todo_inline",
+ 'name' => 't/sample-tests/todo_inline',
'wstat' => ''
}
},
@@ -181,12 +180,12 @@ my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sa
},
'die' => {
'failed' => {
- "$TEST_DIR/die" => {
+ 't/sample-tests/die' => {
'canon' => '??',
'estat' => 1,
'failed' => '??',
'max' => '??',
- 'name' => "$TEST_DIR/die",
+ 'name' => 't/sample-tests/die',
'wstat' => '256'
}
},
@@ -206,12 +205,12 @@ my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sa
},
'die_head_end' => {
'failed' => {
- "$TEST_DIR/die_head_end" => {
+ 't/sample-tests/die_head_end' => {
'canon' => '??',
'estat' => 1,
'failed' => '??',
'max' => '??',
- 'name' => "$TEST_DIR/die_head_end",
+ 'name' => 't/sample-tests/die_head_end',
'wstat' => '256'
}
},
@@ -231,12 +230,12 @@ my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sa
},
'die_last_minute' => {
'failed' => {
- "$TEST_DIR/die_last_minute" => {
+ 't/sample-tests/die_last_minute' => {
'canon' => '??',
'estat' => 1,
'failed' => 0,
'max' => 4,
- 'name' => "$TEST_DIR/die_last_minute",
+ 'name' => 't/sample-tests/die_last_minute',
'wstat' => '256'
}
},
@@ -256,12 +255,12 @@ my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sa
},
'duplicates' => {
'failed' => {
- "$TEST_DIR/duplicates" => {
+ 't/sample-tests/duplicates' => {
'canon' => '??',
'estat' => '',
'failed' => '??',
'max' => 10,
- 'name' => "$TEST_DIR/duplicates",
+ 'name' => 't/sample-tests/duplicates',
'wstat' => ''
}
},
@@ -297,12 +296,12 @@ my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sa
},
'head_fail' => {
'failed' => {
- "$TEST_DIR/head_fail" => {
+ 't/sample-tests/head_fail' => {
'canon' => 2,
'estat' => '',
'failed' => 1,
'max' => 4,
- 'name' => "$TEST_DIR/head_fail",
+ 'name' => 't/sample-tests/head_fail',
'wstat' => ''
}
},
@@ -322,12 +321,12 @@ my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sa
},
'inc_taint' => {
'failed' => {
- "$TEST_DIR/inc_taint" => {
+ 't/sample-tests/inc_taint' => {
'canon' => 1,
'estat' => 1,
'failed' => 1,
'max' => 1,
- 'name' => "$TEST_DIR/inc_taint",
+ 'name' => 't/sample-tests/inc_taint',
'wstat' => '256'
}
},
@@ -379,12 +378,12 @@ my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sa
},
'no_nums' => {
'failed' => {
- "$TEST_DIR/no_nums" => {
+ 't/sample-tests/no_nums' => {
'canon' => 3,
'estat' => '',
'failed' => 1,
'max' => 5,
- 'name' => "$TEST_DIR/no_nums",
+ 'name' => 't/sample-tests/no_nums',
'wstat' => ''
}
},
@@ -404,12 +403,12 @@ my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sa
},
'no_output' => {
'failed' => {
- "$TEST_DIR/no_output" => {
+ 't/sample-tests/no_output' => {
'canon' => '??',
'estat' => '',
'failed' => '??',
'max' => '??',
- 'name' => "$TEST_DIR/no_output",
+ 'name' => 't/sample-tests/no_output',
'wstat' => ''
}
},
@@ -493,12 +492,12 @@ my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sa
},
'simple_fail' => {
'failed' => {
- "$TEST_DIR/simple_fail" => {
+ 't/sample-tests/simple_fail' => {
'canon' => '2 5',
'estat' => '',
'failed' => 2,
'max' => 5,
- 'name' => "$TEST_DIR/simple_fail",
+ 'name' => 't/sample-tests/simple_fail',
'wstat' => ''
}
},
@@ -601,12 +600,12 @@ my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sa
( $ENV{PERL5OPT} || '' ) =~ m{(?:^|\s)-[dM]};
},
'failed' => {
- "$TEST_DIR/switches" => {
+ 't/sample-tests/switches' => {
'canon' => 1,
'estat' => '',
'failed' => 1,
'max' => 1,
- 'name' => "$TEST_DIR/switches",
+ 'name' => 't/sample-tests/switches',
'wstat' => ''
}
},
@@ -660,12 +659,12 @@ my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sa
'todo_inline' => {
'failed' => {},
'todo' => {
- "$TEST_DIR/todo_inline" => {
+ 't/sample-tests/todo_inline' => {
'canon' => 2,
'estat' => '',
'failed' => 1,
'max' => 2,
- 'name' => "$TEST_DIR/todo_inline",
+ 'name' => 't/sample-tests/todo_inline',
'wstat' => ''
}
},
@@ -684,12 +683,12 @@ my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sa
},
'todo_misparse' => {
'failed' => {
- "$TEST_DIR/todo_misparse" => {
+ 't/sample-tests/todo_misparse' => {
'canon' => 1,
'estat' => '',
'failed' => 1,
'max' => 1,
- 'name' => "$TEST_DIR/todo_misparse",
+ 'name' => 't/sample-tests/todo_misparse',
'wstat' => ''
}
},
@@ -709,12 +708,12 @@ my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sa
},
'too_many' => {
'failed' => {
- "$TEST_DIR/too_many" => {
+ 't/sample-tests/too_many' => {
'canon' => '4-7',
'estat' => 4,
'failed' => 4,
'max' => 3,
- 'name' => "$TEST_DIR/too_many",
+ 'name' => 't/sample-tests/too_many',
'wstat' => '1024'
}
},
@@ -734,12 +733,12 @@ my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sa
},
'vms_nit' => {
'failed' => {
- "$TEST_DIR/vms_nit" => {
+ 't/sample-tests/vms_nit' => {
'canon' => 1,
'estat' => '',
'failed' => 1,
'max' => 2,
- 'name' => "$TEST_DIR/vms_nit",
+ 'name' => 't/sample-tests/vms_nit',
'wstat' => ''
}
},
@@ -786,13 +785,13 @@ my $TEST_DIR = $ENV{PERL_CORE} ? 'lib/sa
return $hash unless $^O eq 'VMS';
while ( my ( $file, $want ) = each %$hash ) {
- for (qw( estat wstat )) {
+ for ( qw( estat wstat ) ) {
if ( exists $want->{$_} ) {
$want->{$_} = $want->{$_} ? 1 : 0;
}
}
}
- return $hash;
+ return $hash
}
{
Thread Next
-
Test::Harness differences
by Nicholas Clark