6 BEGIN { delete $ENV{PATH} }
8 use Test::Valgrind::Session;
10 use Test::More tests => 7;
13 use Test::Valgrind::FakeValgrind;
15 my $sess = eval { Test::Valgrind::Session->new(
18 like $@, qr/^Empty valgrind candidates list/, 'no search_dirs';
20 $sess = eval { Test::Valgrind::Session->new(
23 like $@, qr/^No appropriate valgrind executable/, 'nonexistant valgrind';
26 my $old_vg = Test::Valgrind::FakeValgrind->new(
29 skip $old_vg => 5 unless ref $old_vg;
31 my $sess = eval { Test::Valgrind::Session->new(
32 valgrind => $old_vg->path,
33 min_version => '3.1.0',
35 like $@, qr/^No appropriate valgrind executable/, 'old valgrind';
37 my $new_vg = Test::Valgrind::FakeValgrind->new(
40 skip $new_vg => 4 unless ref $new_vg;
42 $sess = eval { Test::Valgrind::Session->new(
43 valgrind => $new_vg->path,
44 min_version => '3.1.0',
46 is $@, '', 'new valgrind';
47 isa_ok $sess, 'Test::Valgrind::Session', 'new valgrind isa Test::Valgrind::Session';
49 $sess = eval { Test::Valgrind::Session->new(
51 valgrind => [ $old_vg->path, $new_vg->path ],
52 min_version => '3.1.0',
54 is $@, '', 'old and new valgrind';
55 isa_ok $sess, 'Test::Valgrind::Session', 'old and new valgrind isa Test::Valgrind::Session';