8 use Test::Valgrind::Command;
9 use Test::Valgrind::Tool;
10 use Test::Valgrind::Session;
12 my $cmd = Test::Valgrind::Command->new(
17 my $tool = Test::Valgrind::Tool->new(
21 my $sess = eval { Test::Valgrind::Session->new(
22 min_version => $tool->requires_version,
34 my $file = $sess->def_supp_file;
36 like($file, qr!\Q$Test::Valgrind::Session::VERSION\E/memcheck-\d+(?:\.\d+)*-[0-9a-f]{32}\.supp$!, 'suppression file is correctly named');
37 ok(-e $file, 'suppression file exists');
38 ok(-r $file, 'suppression file is readable');
40 if (not open my $supp, '<', $file) {
41 fail("Couldn't open the suppression file at $file: $!");
43 pass("Could open the suppression file");
44 my ($in, $count, $true, $line) = (0, 0, 0, 0);
50 if (!$in && $_ eq '{') {
52 } elsif ($in && $_ eq '}') {
54 ++$true if $line - $in >= 2;
58 diag "$count suppressions, of which $true are not empty";