use Test::More;
use lib 't/lib';
-eval 'use Test::Valgrind';
+
+eval {
+ require Test::Valgrind;
+ Test::Valgrind->import;
+};
if ($@) {
diag $@;
- plan skip_all => 'Test::Valgrind is required to run test your distribution with valgrind';
+ plan skip_all
+ => 'Test::Valgrind is required to test your distribution with valgrind';
}
{
use Test::More;
use lib 't/lib';
-eval 'use Test::Valgrind action => q[Test::Valgrind::Test::Action]';
+
+eval {
+ require Test::Valgrind;
+ Test::Valgrind->import(action => 'Test::Valgrind::Test::Action');
+};
if ($@) {
diag $@;
- plan skip_all => 'Test::Valgrind is required to run test your distribution with valgrind';
+ plan skip_all
+ => 'Test::Valgrind is required to test your distribution with valgrind';
}
eval {
require XSLoader;
XSLoader::load('Test::Valgrind', $Test::Valgrind::VERSION);
};
-
-unless ($@) {
- Test::Valgrind::leak();
-} else {
+if ($@) {
diag $@;
+} else {
+ Test::Valgrind::leak();
}