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,
26 $err =~ s/^(Empty valgrind candidates list|No appropriate valgrind executable could be found)\s+at.*/$1/;
27 plan skip_all => $err;
35 my $file = $sess->def_supp_file;
37 like($file, qr!\Q$Test::Valgrind::Session::VERSION\E/memcheck-\d+(?:\.\d+)*-[0-9a-f]{32}\.supp$!, 'suppression file is correctly named');
38 ok(-e $file, 'suppression file exists');
39 ok(-r $file, 'suppression file is readable');
41 if (not open my $supp, '<', $file) {
42 fail("Couldn't open the suppression file at $file: $!");
44 pass("Could open the suppression file");
45 my ($in, $count, $true, $line) = (0, 0, 0, 0);
51 if (!$in && $_ eq '{') {
53 } elsif ($in && $_ eq '}') {
55 ++$true if $line - $in >= 2;
59 diag "$count suppressions, of which $true are not empty";