6 use Test::More tests => 4;
8 use Test::Valgrind::Command;
9 use Test::Valgrind::Tool;
10 use Test::Valgrind::Action;
11 use Test::Valgrind::Session;
13 my $cmd = Test::Valgrind::Command->new(
18 my $tool = Test::Valgrind::Tool->new(
22 my $sess = Test::Valgrind::Session->new(
23 min_version => $tool->requires_version,
29 my $file = $sess->def_supp_file;
31 like($file, qr!\Q$Test::Valgrind::Session::VERSION\E/memcheck-\d+(?:\.\d+)*-[0-9a-f]{32}\.supp$!, 'suppression file is correctly named');
32 ok(-e $file, 'suppression file exists');
33 ok(-r $file, 'suppression file is readable');
35 if (not open my $supp, '<', $file) {
36 fail("Couldn't open the suppression file at $file: $!");
38 pass("Could open the suppression file");
39 my ($in, $count, $true, $line) = (0, 0, 0, 0);
45 if (!$in && $_ eq '{') {
47 } elsif ($in && $_ eq '}') {
49 ++$true if $line - $in >= 2;
53 diag "$count suppressions, of which $true are not empty";