From: Vincent Pit Date: Sat, 27 Sep 2008 22:28:49 +0000 (+0200) Subject: In t/30-bad.t, first load Test::Valgrind and then the XS code (whenever possible... X-Git-Tag: v0.07~15 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=62b584c5dfcafeecf8afa55570eef9b3106f0f3d;p=perl%2Fmodules%2FTest-Valgrind.git In t/30-bad.t, first load Test::Valgrind and then the XS code (whenever possible), as loading the latter first actually loads the former --- diff --git a/t/30-bad.t b/t/30-bad.t index 4250639..f3313b0 100644 --- a/t/30-bad.t +++ b/t/30-bad.t @@ -29,18 +29,20 @@ sub tester { return $passed; } -eval " - require XSLoader; - XSLoader::load('Test::Valgrind', 0.06); -"; +use lib qw{blib/archpub}; +eval 'use Test::Valgrind cb => \&tester'; if ($@) { - plan skip_all => "XS test code not available ($@)"; + diag $@; + plan skip_all => 'Test::Valgrind is required to run test your distribution with valgrind'; } else { - use lib qw{blib/archpub}; - eval 'use Test::Valgrind cb => \&tester;'; + eval " + use lib qw{blib/arch}; + require XSLoader; + XSLoader::load('Test::Valgrind', \$Test::Valgrind::VERSION); + "; if ($@) { diag $@; - plan skip_all => 'Test::Valgrind is required to run test your distribution with valgrind'; + plan skip_all => "XS test code not available"; } else { Test::Valgrind::leak(); }