I have svn commit access but no idea how to use it prooperly so attached is a 5 line patch to Test::Builder to make it say things like
1..2 not ok 1 # Failed test in stack.t at line 4. # Called from stack.t at line 8. not ok 2 - wibble # Failed test 'wibble' # in stack.t at line 5. # Called from stack.t at line 8. # Looks like you failed 2 tests of 2. where stack.t is use Test::More tests => 2; sub f { fail(); fail("wibble"); } f() F
Index: lib/Test/Builder.pm =================================================================== --- lib/Test/Builder.pm (revision 3740) +++ lib/Test/Builder.pm (working copy) @@ -456,6 +456,11 @@ else { $self->diag(qq[ $msg test in $file at line $line.\n]); } + my $frame = 1; + while (my ($pack, $file, $line) = $self->caller($frame)) { + $self->diag(qq[ Called from $file at line $line.\n]); + $frame++; + } } return $test ? 1 : 0;