
marvin at rectangular
Sep 10, 2008, 11:04 AM
Post #1 of 1
(2521 views)
Permalink
|
|
r3860 - trunk/perl/buildlib/Lucy
|
|
Author: creamyg Date: 2008-09-10 11:04:01 -0700 (Wed, 10 Sep 2008) New Revision: 3860 Modified: trunk/perl/buildlib/Lucy/Build.pm Log: Accommodate older versions of Valgrind with regards to screen-scraping output. Allow extra suppressions files to be supplied as a comma-separated list argument to ./Build test_valgrind. Modified: trunk/perl/buildlib/Lucy/Build.pm =================================================================== --- trunk/perl/buildlib/Lucy/Build.pm 2008-09-10 15:11:56 UTC (rev 3859) +++ trunk/perl/buildlib/Lucy/Build.pm 2008-09-10 18:04:01 UTC (rev 3860) @@ -312,6 +312,16 @@ $] == 5.0008008 ? "p588_valgrind.supp" : "p510_valgrind.supp"; + my $valgrind_command + = "PERL_DESTRUCT_LEVEL=2 KINO_VALGRIND=1 valgrind " + . "--leak-check=yes " + . "--show-reachable=yes " + . "--suppressions=$supp_file "; + if ( my $local_supp = $self->args('suppressions') ) { + for my $supp ( split( ',', $local_supp ) ) { + $valgrind_command .= "--suppressions=$supp "; + } + } # Iterate over test files. my @failed; @@ -320,20 +330,15 @@ # Run test file under Valgrind. print "Testing $t_file..."; die "Can't find '$t_file'" unless -f $t_file; - my $command - = "PERL_DESTRUCT_LEVEL=2 KINO_VALGRIND=1 valgrind " - . "--leak-check=yes " - . "--show-reachable=yes " - . "--suppressions=$supp_file " - . "$^X -Mblib $t_file 2>&1"; + my $command = "$valgrind_command $^X -Mblib $t_file 2>&1"; my $output = "\n" . ( scalar localtime(time) ) . "\n$command\n"; $output .= `$command`; # Screen-scrape Valgrind output, looking for errors and leaks. - if ( $output =~ /ERROR SUMMARY: [^0]/ - or $output =~ /definitely lost: [^0]/ - or $output =~ /possibly lost: [^0]/ - or $output =~ /still reachable: [^0]/ ) + if ( $output =~ /ERROR SUMMARY:\s+[^0\s]/ + or $output =~ /definitely lost:\s+[^0\s]/ + or $output =~ /possibly lost:\s+[^0\s]/ + or $output =~ /still reachable:\s+[^0\s]/ ) { print " failed.\n"; push @failed, $t_file; _______________________________________________ kinosearch-commits mailing list kinosearch-commits [at] rectangular http://www.rectangular.com/mailman/listinfo/kinosearch-commits
|