From c7bbb4e639caed8f5387c505b36342e51d87eae9 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 6 Apr 2011 10:01:46 -0500 Subject: [PATCH] count explicit Carps as compile warnings --- t/00_compile.t | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/00_compile.t b/t/00_compile.t index 61826e1a2a..db31d160af 100644 --- a/t/00_compile.t +++ b/t/00_compile.t @@ -37,9 +37,10 @@ foreach my $library (@modules) { local $SIG{__WARN__} = sub { my $warn = shift; # file the warning occurred in + my $caller = caller; my $warning_file = realpath( (caller(0))[1] ); - # only care about it if it is within the WebGUI lib directory - if ($warning_file =~ /^\Q$wgLib/) { + # only care about it if it is within the WebGUI lib directory or is an explicit warning + if ($warning_file =~ /^\Q$wgLib/ || $caller eq 'Carp') { $warnings .= $warn; } };