-$sess = eval { Test::Valgrind::Session->new(
- search_dirs => [ ],
- valgrind => [ $vg_old->filename, $vg_new->filename ],
- min_version => '3.1.0',
-) };
-is $@, '', 'old and new valgrind';
-isa_ok $sess, 'Test::Valgrind::Session', 'old and new valgrind isa Test::Valgrind::Session';
+ $fake_vg_code = fake_vg('3.4.0');
+ skip 'Could not generate the dummy valgrind executable' => 4
+ unless defined $fake_vg_code;
+
+ my $vg_new = File::Temp->new(UNLINK => 1);
+ print $vg_new $fake_vg_code;
+ close $vg_new;
+ chmod 0755, $vg_new->filename;
+
+ $sess = eval { Test::Valgrind::Session->new(
+ valgrind => $vg_new->filename,
+ min_version => '3.1.0',
+ ) };
+ is $@, '', 'new valgrind';
+ isa_ok $sess, 'Test::Valgrind::Session', 'new valgrind isa Test::Valgrind::Session';
+
+ $sess = eval { Test::Valgrind::Session->new(
+ search_dirs => [ ],
+ valgrind => [ $vg_old->filename, $vg_new->filename ],
+ min_version => '3.1.0',
+ ) };
+ is $@, '', 'old and new valgrind';
+ isa_ok $sess, 'Test::Valgrind::Session', 'old and new valgrind isa Test::Valgrind::Session';
+}