dagolden/test-failwarnings — pull request #4 by guillaumeaubert (2013-08-25 02:21:13+00:00)
Title: Handle local dependencies with absolute filenames.

I noticed today in my DBIx::NinjaORM project that Test::FailWarnings with `-allow_deps => 1` was failing when running individual tests with `perl -T -I lib t/...` but passing when using `prove`.

`prove` seems to cause caller() to systematically report absolute filenames (at least on my test machine, Ubuntu / Perl 5.10). Since Test::FailWarnings checks for local dependencies using `/^(?:t|xt|lib|blib)/`, local directories with absolute paths end up incorrectly not being considered local.

Attached is a proposed patch to make the file path relative if the file path reported is below the current path, which addresses this problem. I haven't tested on Windows, but I added the corresponding patterns in the regexps as well.

Thank you for considering this pull request!