in reply to Re^2: A unit-test script that causes remorse
in thread A unit-test script that causes remorse

Good idea. Take a look at Module::Load. I've used it in some of my distributions where I've needed to dynamically load modules by module or file name based on conditions and whether they are available. May be of use to you here.

Regarding the sub redefined issue, you're not copying a module to a new name without changing the package name within for testing are you? I can't trigger this unless I copy one module, as-is, to another module name. eg: copy lib/Module.pm to lib/ModuleWithoutTests.pm without changing the package name within the copied file.

Granted though, I only spent a couple of minutes playing so I very well could be overlooking something...

Replies are listed 'Best First'.
Re^4: A unit-test script that causes remorse
by Dallaylaen (Chaplain) on Sep 05, 2016 at 17:24 UTC

    copy lib/Module.pm to lib/ModuleWithoutTests.pm without changing the package name within the copied file.

    You nailed it. Cover includes modules from blib and not lib, and it seems to keep them ALL in one process to get coverage.

    Perhaps I should just skip modules already loaded. I'll do when I get some round tuits for this. (Gonna find some time to work, too...).