From: Vincent Pit Date: Tue, 22 Sep 2009 11:44:28 +0000 (+0200) Subject: Remove stack traces from common error messages X-Git-Tag: v1.10~3 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FTest-Valgrind.git;a=commitdiff_plain;h=b53c95bc4c9013591c3051dd69d472518474d620 Remove stack traces from common error messages --- diff --git a/lib/Test/Valgrind.pm b/lib/Test/Valgrind.pm index 5c1c8bb..1e563a8 100644 --- a/lib/Test/Valgrind.pm +++ b/lib/Test/Valgrind.pm @@ -168,7 +168,9 @@ sub analyse { ); }; unless ($sess) { - $action->abort($sess, $@); + my $err = $@; + $err =~ s/^(Empty valgrind candidates list|No appropriate valgrind executable could be found)\s+at.*/$1/; + $action->abort($sess, $err); return $action->status($sess); } diff --git a/t/80-suppressions.t b/t/80-suppressions.t index b6f22c7..bb93875 100644 --- a/t/80-suppressions.t +++ b/t/80-suppressions.t @@ -22,8 +22,9 @@ my $sess = eval { Test::Valgrind::Session->new( min_version => $tool->requires_version, ) }; -if ($@) { - plan skip_all => $@; +if (my $err = $@) { + $err =~ s/^(Empty valgrind candidates list|No appropriate valgrind executable could be found)\s+at.*/$1/; + plan skip_all => $err; } else { plan tests => 4; }