=item *
+C<< command => $command >>
+
+The L<Test::Valgrind::Command> object (or class name) to use.
+
+Defaults to L<Test::Valgrind::Command::PerlScript>.
+
+=item *
+
C<< tool => $tool >>
The L<Test::Valgrind::Tool> object (or class name) to use.
return;
}
- require Test::Valgrind::Command;
- my $cmd = Test::Valgrind::Command->new(
- command => 'PerlScript',
- file => $file,
- args => [ '-MTest::Valgrind=run,1' ],
- );
-
my $instanceof = sub {
require Scalar::Util;
Scalar::Util::blessed($_[0]) && $_[0]->isa($_[1]);
};
+ my $cmd = delete $args{command};
+ unless ($cmd->$instanceof('Test::Valgrind::Command')) {
+ require Test::Valgrind::Command;
+ $cmd = Test::Valgrind::Command->new(
+ command => $cmd || 'PerlScript',
+ file => $file,
+ args => [ '-MTest::Valgrind=run,1' ],
+ );
+ }
+
my $tool = delete $args{tool};
unless ($tool->$instanceof('Test::Valgrind::Tool')) {
require Test::Valgrind::Tool;