moznion/Test-UsedModules — pull request #2 by jemmix (2014-10-17 16:04:57+00:00)
Title: Add $MODULES_WHITELIST setting

Hi!

I'm trying to make use of Test::UsedModules in a large Perl project codebase. It turns out that there are in fact many places there that would be in violation and I can't fix all of them at once. I would rather do that incrementally, one module at a time.

Besides, there are some modules (e. g. SOAP::Lite) that are used in a way that Test::UsedModules doesn't detect. SOAP::Lite in particular defines multiple packages in one file and we have instances of files that refer to those packages but not to SOAP::Lite itself. Another case we have is that certain modules are registering handler functions in a global table. When these functions are called, they are being referred to indirectly by name, not called explicitly.

I have managed to patch Test::UsedModules to solve those two problems at once by adding a module whitelist. Modules in the whitelist do not trigger test failures, allowing me to use SOAP::Lite without actually referring to the very same package name, using other packages defined by that instead.

Please take a look. Thank you!