
Test::failwarnings hooks $sig{__warn__} and converts warnings to test::more's fail() calls. it is designed to be used with done_testing, when you don't need to know the test count in advance.
just as with test::nowarnings, this does not catch warnings if other things localize $sig{__warn__}, as this is designed to catch unhandled warnings.