From: Vincent Pit Date: Sun, 29 Jun 2008 15:58:45 +0000 (+0200) Subject: Importing Test-Valgrind-0.04.tar.gz X-Git-Tag: v0.04^0 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=7afc3697a183708c5c8efe99ebd40c01e173e0b1;p=perl%2Fmodules%2FTest-Valgrind.git Importing Test-Valgrind-0.04.tar.gz --- diff --git a/Changes b/Changes index 95ebd37..aece5d7 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ Revision history for Test-Valgrind +0.04 2008-05-13 16:25 UTC + + Chg : Don't smoke this on 5.005 please. + + Chg : Better way to find the valgrind executable. + 0.03 2008-04-21 15:35 UTC + Fix : Include the mock Suppressions.pm rather than an empty file. diff --git a/META.yml b/META.yml index b6e5716..61a6830 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: Test-Valgrind -version: 0.03 +version: 0.04 abstract: Test Perl code through valgrind. license: perl author: diff --git a/Makefile.PL b/Makefile.PL index 1d37fb9..221229f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,25 +1,26 @@ +use 5.006; + use strict; use warnings; use ExtUtils::MakeMaker; -my $has_vg = 0; my $vg; print 'Checking for valgrind >= 3.1.0 in PATH... '; for (split /:/, $ENV{PATH}) { - $vg = $_ . '/valgrind'; - if (-x $vg) { - my $ver = qx/$vg --version/; + $_ .= '/valgrind'; + if (-x) { + my $ver = qx/$_ --version/; if ($ver =~ s/^valgrind-//) { $ver = join '', map chr, split /\./, $ver; if ($ver ge v3.1.0) { - print "yes, $vg\n"; - $has_vg = 1; + print "yes, $_\n"; + $vg = $_; last; } } } } -if (!$has_vg) { +if (!$vg) { print "no\n"; die 'OS unsupported'; } diff --git a/README b/README index 55a7247..10e0c55 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME Test::Valgrind - Test Perl code through valgrind. VERSION - Version 0.03 + Version 0.04 SYNOPSIS use Test::More; diff --git a/lib/Test/Valgrind.pm b/lib/Test/Valgrind.pm index 506e11f..dd367da 100644 --- a/lib/Test/Valgrind.pm +++ b/lib/Test/Valgrind.pm @@ -17,11 +17,11 @@ Test::Valgrind - Test Perl code through valgrind. =head1 VERSION -Version 0.03 +Version 0.04 =cut -our $VERSION = '0.03'; +our $VERSION = '0.04'; =head1 SYNOPSIS @@ -88,20 +88,22 @@ sub import { $file = $next; } return if not $file or $file eq '-e'; - my $valgrind; - for (split /:/, $ENV{PATH}) { - my $vg = $_ . '/valgrind'; - if (-x $vg) { - $valgrind = $vg; - last; - } - } - if (!$valgrind) { - plan skip_all => 'No valgrind executable could be found in your path'; - return; - } my $callers = $args{callers} || 50; $callers = int $callers; + my $vg = Test::Valgrind::Suppressions::VG_PATH; + if (!$vg || !-x $vg) { + for (split /:/, $ENV{PATH}) { + $_ .= '/valgrind'; + if (-x) { + $vg = $_; + last; + } + } + if (!$vg) { + plan skip_all => 'No valgrind executable could be found in your path'; + return; + } + } pipe my $rdr, my $wtr or croak "pipe(\$rdr, \$wtr): $!"; my $pid = fork; if (!defined $pid) { @@ -131,7 +133,6 @@ sub import { print STDERR "valgrind @args\n" if $args{diag}; local $ENV{PERL_DESTRUCT_LEVEL} = 3; local $ENV{PERL_DL_NONLAZY} = 1; - my $vg = Test::Valgrind::Suppressions::VG_PATH; exec $vg, @args if $vg and -x $vg; } close $wtr or croak "close(\$wtr): $!"; diff --git a/lib/Test/Valgrind/Suppressions.pm b/lib/Test/Valgrind/Suppressions.pm index 8b2a1e9..6983537 100644 --- a/lib/Test/Valgrind/Suppressions.pm +++ b/lib/Test/Valgrind/Suppressions.pm @@ -9,11 +9,11 @@ Test::Valgrind::Suppressions - Placeholder for architecture-dependant perl suppr =head1 VERSION -Version 0.03 +Version 0.04 =cut -our $VERSION = '0.03'; +our $VERSION = '0.04'; =head1 DESCRIPTION diff --git a/lib/Test/Valgrind/Suppressions.tpl b/lib/Test/Valgrind/Suppressions.tpl index 8b2a1e9..6983537 100644 --- a/lib/Test/Valgrind/Suppressions.tpl +++ b/lib/Test/Valgrind/Suppressions.tpl @@ -9,11 +9,11 @@ Test::Valgrind::Suppressions - Placeholder for architecture-dependant perl suppr =head1 VERSION -Version 0.03 +Version 0.04 =cut -our $VERSION = '0.03'; +our $VERSION = '0.04'; =head1 DESCRIPTION