]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - test/run_tests.pl
augment test/run_tests.pl to filter indirect leaks
[thirdparty/openssl.git] / test / run_tests.pl
index 90fba194b11bec4e82dcff9420fe54701b39cc66..1f4406a49fa1db9dc77ceba864f3f45ac8e5d828 100644 (file)
@@ -175,6 +175,7 @@ $eres = eval {
         my $failure_verbosity = $openssl_args{failure_verbosity};
         my @plans = (); # initial level, no plan yet
         my $output_buffer = "";
+        my $in_indirect = 0;
 
         # We rely heavily on perl closures to make failure verbosity work
         # We need to do so, because there's no way to safely pass extra
@@ -211,7 +212,21 @@ $eres = eval {
                         $output_buffer = ""; # ignore comments etc. until plan
                     } elsif ($is_test) { # result of a test
                         pop @plans if @plans && --($plans[-1]) <= 0;
-                        print $output_buffer if !$is_ok;
+                        if ($output_buffer =~ /.*Indirect leak of.*/ == 1) {
+                            my @asan_array = split("\n", $output_buffer);
+                            foreach (@asan_array) {
+                                if ($_ =~ /.*Indirect leak of.*/ == 1) {
+                                    $in_indirect = 1;
+                                } else {
+                                    if ($_ =~ /^    #.*/ == 0) {
+                                        $in_indirect = 0;
+                                    }
+                                }
+                                print "$_\n" if !$in_indirect;
+                            }
+                        } else {
+                            print $output_buffer if !$is_ok;
+                        }
                         print "\n".$self->as_string
                             if !$is_ok || $failure_verbosity == 2;
                         print "\n# ------------------------------------------------------------------------------" if !$is_ok;