6 use Test::More tests => 2;
8 use Test::Valgrind::Command;
9 use Test::Valgrind::Tool;
10 use Test::Valgrind::Session;
13 use Test::Valgrind::FakeValgrind;
15 my $cmd = Test::Valgrind::Command->new(
21 package Test::Valgrind::Parser::Dummy;
23 use base 'Test::Valgrind::Parser';
29 package Test::Valgrind::Tool::Dummy;
31 use base 'Test::Valgrind::Tool::memcheck';
33 sub parser_class { 'Test::Valgrind::Parser::Dummy' }
36 my $tool = Test::Valgrind::Tool::Dummy->new();
39 package Test::Valgrind::Action::Dummy;
41 use base 'Test::Valgrind::Action';
43 sub do_suppressions { 0 }
46 my ($self, $sess, $report) = @_;
48 if ($report->is_diag) {
49 my $contents = $report->data;
50 if ($contents !~ /^(?:Using valgrind |No suppressions used)/) {
55 $self->SUPER::report($sess, $report);
60 my $action = Test::Valgrind::Action::Dummy->new();
67 my $dummy_vg = Test::Valgrind::FakeValgrind->new(
68 exe_name => 'invisible_pink_unicorn'
70 skip $dummy_vg => 2 unless ref $dummy_vg;
71 $tmp_vg = $dummy_vg->path;
75 Test::Valgrind::Session->new(
81 is $@, '', 'session was correctly created';
84 skip 'dummy valgrind executable was not deleted' => 1 if -e $tmp_vg;
94 like $@, qr/invisible_pink_unicorn/, 'command not found croaks';