use Carp qw/croak/;
use POSIX qw/SIGTERM/;
-use Test::More;
+use Test::Builder;
use Perl::Destruct::Level level => 3;
=cut
+my $Test = Test::Builder->new;
+
my $run;
sub _counter {
}
sub _tester {
- is($_[0], 0, $_[1]);
+ $Test->is_num($_[0], 0, $_[1]);
_counter(@_);
}
}
}
if (!$vg) {
- plan skip_all => 'No valgrind executable could be found in your path';
+ $Test->plan(skip_all => 'No valgrind executable could be found in your path');
return;
}
}
}
close $wtr or croak "close(\$wtr): $!";
local $SIG{INT} = sub { kill -(SIGTERM) => $pid };
- plan tests => 5 unless $args{no_test};
+ $Test->plan(tests => 5) unless $args{no_test};
my @tests = (
'errors',
'definitely lost', 'indirectly lost', 'possibly lost', 'still reachable'
);
my %res = map { $_ => 0 } @tests;
while (<$rdr>) {
- diag $_ if $args{diag};
+ $Test->diag($_) if $args{diag};
if (/^=+\d+=+\s*FATAL\s*:\s*(.*)/) {
chomp(my $err = $1);
- diag "Valgrind error: $err";
+ $Test->diag("Valgrind error: $err");
$res{$_} = undef for @tests;
}
if (/ERROR\s+SUMMARY\s*:\s+(\d+)/) {
Valgrind 3.1.0 (L<http://valgrind.org>).
-L<Carp>, L<POSIX> (core modules since perl 5) and L<Test::More> (since 5.6.2).
+L<Carp>, L<POSIX> (core modules since perl 5) and L<Test::Builder> (since 5.6.2).
L<Perl::Destruct::Level>.