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

Thanks, added it. I try to require File::Find::Rule and fall back to shell in case it's not there.

  • Comment on Re^2: A unit-test script that causes remorse

Replies are listed 'Best First'.
Re^3: A unit-test script that causes remorse
by stevieb (Canon) on Sep 05, 2016 at 17:07 UTC

    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...

      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...).

Re^3: A unit-test script that causes remorse
by Your Mother (Archbishop) on Sep 05, 2016 at 21:38 UTC

    This might break WIN. Better to require it or to use a more simple version of file finding that is core.

      Agreed. Updated to File::Find, and it actually ran on a Windows box, "testing" an empty module.