6 BEGIN { delete $ENV{PATH} }
8 use Test::More tests => 2;
10 use Test::Valgrind::Command;
11 use Test::Valgrind::Tool;
12 use Test::Valgrind::Session;
15 use Test::Valgrind::FakeValgrind;
17 my $cmd = Test::Valgrind::Command->new(
23 package Test::Valgrind::Parser::Dummy;
25 use base 'Test::Valgrind::Parser';
31 package Test::Valgrind::Tool::Dummy;
33 use base 'Test::Valgrind::Tool::memcheck';
35 sub parser_class { 'Test::Valgrind::Parser::Dummy' }
38 my $tool = Test::Valgrind::Tool::Dummy->new();
41 package Test::Valgrind::Action::Dummy;
43 use base 'Test::Valgrind::Action';
45 sub do_suppressions { 0 }
48 my ($self, $sess, $report) = @_;
50 if ($report->is_diag) {
51 my $contents = $report->data;
52 if ($contents !~ /^(?:Using valgrind |No suppressions used)/) {
57 $self->SUPER::report($sess, $report);
62 my $action = Test::Valgrind::Action::Dummy->new();
69 my $dummy_vg = Test::Valgrind::FakeValgrind->new(
70 exe_name => 'invisible_pink_unicorn'
72 skip $dummy_vg => 2 unless ref $dummy_vg;
73 $tmp_vg = $dummy_vg->path;
77 Test::Valgrind::Session->new(
83 is $@, '', 'session was correctly created';
86 skip 'dummy valgrind executable was not deleted' => 1 if -e $tmp_vg;
96 like $@, qr/invisible_pink_unicorn/, 'command not found croaks';