my $WHOAMI = ref bless []; # nobody's business, prolly not even mine
local $| = 1;
-my $_;
+local $_;
local $.;
my $standalone;
{
print STDERR "FINISHING COMPILATION for $_\n" if $DEBUG;
local $/ = '';
+ local $_;
my $header;
my @headers;
my $for_item;
my $count;
my $wantspace;
sub splainthis {
- return 0 if $TRACEONLY;
- $_ = shift;
+ return 0 if $TRACEONLY;
+ for (my $tmp = shift) {
local $\;
local $!;
### &finish_compilation unless %msg;
return 0 unless &transmo;
}
- $orig = shorten($orig);
+ my $short = shorten($orig);
if ($old_diag{$_}) {
autodescribe();
- print THITHER "$orig (#$old_diag{$_})\n";
+ print THITHER "$short (#$old_diag{$_})\n";
$wantspace = 1;
+ } elsif (!$msg{$_} && $orig =~ /\n./s) {
+ # A multiline message, like "Attempt to reload /
+ # Compilation failed"
+ my $found;
+ for (split /^/, $orig) {
+ splainthis($_) and $found = 1;
+ }
+ return $found;
} else {
autodescribe();
$old_diag{$_} = ++$count;
print THITHER "\n" if $wantspace;
$wantspace = 0;
- print THITHER "$orig (#$old_diag{$_})\n";
+ print THITHER "$short (#$old_diag{$_})\n";
if ($msg{$_}) {
print THITHER $msg{$_};
} else {
}
}
return 1;
+ }
}
sub autodescribe {
chdir '..' if -d '../pod' && -d '../t';
@INC = 'lib';
require './t/test.pl';
- plan(16);
+ plan(17);
}
BEGIN {
# Errors ending with dots
seek STDERR, 0,0;
$warning = '';
-warn "Attempt to reload stuff aborted.\n";
-like $warning, qr/You tried to load a file/, 'dotty errors';
+warn "I had compilation errors.\n";
+like $warning, qr/final summary message/, 'dotty errors';
+
+# Multiline errors
+seek STDERR, 0,0;
+$warning = '';
+warn "Attempt to reload weapon aborted.\nCompilation failed in require";
+like $warning,
+ qr/You tried to load a file.*Perl could not compile/s,
+ 'multiline errors';
*STDERR = $old_stderr;