Skip to content

Commit

Permalink
Don't run change.t and md5.t below 5.10.
Browse files Browse the repository at this point in the history
In 5.8.[2-9] there is an error on non-threaded perls with "can't locate
structure for statement", and I can't be bothered track it down and fix or
work around it.  Let's just bump the minimum recommended version to 5.10, and
keep 5.6.1 and 5.8 as "best effort".
  • Loading branch information
pjcj committed Apr 5, 2014
1 parent a18f0dd commit 4b62927
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 29 deletions.
26 changes: 12 additions & 14 deletions tests/change.t
Expand Up @@ -15,8 +15,13 @@ use File::Copy;
use Devel::Cover::Inc;
use Devel::Cover::Test;

if ($] == 5.008007)
{
if ($] < 5.010) {
eval "use Test::More skip_all => 'Test requires perl 5.10.0 or greater'";
# can't locate structure for statement
exit;
}

if ($] == 5.008007) {
eval "use Test::More skip_all => 'Crashes 5.8.7'";
exit;
}
Expand All @@ -27,22 +32,16 @@ my $t = "change";
my $ft = "$base/tests/$t";
my $fg = "$base/tests/trivial";

my $run_test = sub
{
my $run_test = sub {
my $test = shift;

copy($fg, $ft) or die "Cannot copy $fg to $ft: $!";

$test->run_command($test->test_command);

# sleep 1;

copy($fg, $ft) or die "Cannot copy $fg to $ft: $!";

open T, ">>$ft" or die "Cannot open $ft: $!";
print T <<'EOT';
sub new_sub
{
sub new_sub {
my $y = 1;
}
Expand All @@ -54,11 +53,10 @@ EOT
$test->run_command($test->test_command);
};

my $test = Devel::Cover::Test->new
(
my $test = Devel::Cover::Test->new(
$t,
run_test => $run_test,
end => sub { unlink $ft },
run_test => $run_test,
end => sub { unlink $ft },
no_report => 0,
);

Expand Down
28 changes: 13 additions & 15 deletions tests/md5.t
Expand Up @@ -15,40 +15,38 @@ use File::Copy;
use Devel::Cover::Inc;
use Devel::Cover::Test;

if ($] < 5.010) {
eval "use Test::More skip_all => 'Test requires perl 5.10.0 or greater'";
# can't locate structure for statement
exit;
}

if ($] == 5.008007) {
eval "use Test::More skip_all => 'Crashes 5.8.7'";
exit;
}

my $base = $Devel::Cover::Inc::Base;

my $t = "md5";
my $ft = "$base/tests/$t";
my $fg = "$base/tests/trivial";

if ($] == 5.008007)
{
eval "use Test::More skip_all => 'Crashes 5.8.7'";
exit;
}

my $run_test = sub
{
my $run_test = sub {
my $test = shift;

copy($fg, $ft) or die "Cannot copy $fg to $ft: $!";

open T, ">>$ft" or die "Cannot open $ft: $!";
print T "# blah blah\n";
close T or die "Cannot close $ft: $!";

$test->run_command($test->test_command);

# sleep 1;

copy($fg, $ft) or die "Cannot copy $fg to $ft: $!";

$test->{test_parameters} .= " -merge 1";
$test->run_command($test->test_command);
};

my $test = Devel::Cover::Test->new
(
my $test = Devel::Cover::Test->new(
$t,
run_test => $run_test,
end => sub { unlink $ft },
Expand Down

0 comments on commit 4b62927

Please sign in to comment.