in reply to Re^4: Local library for module test script
in thread Local library for module test script

I'm actually amazed that anyone would think that test suite files *ought* to be runnable from everywhere.
It certainly doesn't hold true for the test files of perl itself and I don't really see that it ought to hold true for perl, perl modules or any other package that contains a test suite.
But, I guess that those of us who are free to define our own expectations should simply be grateful for that opportunity and not get too carried away when the expectations of others don't quite match our own.

Cheers,
Rob
  • Comment on Re^5: Local library for module test script

Replies are listed 'Best First'.
Re^6: Local library for module test script
by GrandFather (Saint) on Dec 03, 2014 at 20:17 UTC

    I find it convenient to use light weight test driven development at times and then being able to run the current test from my IDE is a real boon. Often that means I'd rather run the test script from the test script folder, but I generally achieve that by adding something like use lib '../' which is pretty light weight and inoffensive.

    Perl is the programming world's equivalent of English
Re^6: Local library for module test script
by Anonymous Monk on Dec 03, 2014 at 20:56 UTC

    I'm actually amazed that anyone would think that test suite files *ought* to be runnable from everywhere... expectations ...

    Sure, why not? Its only perl code after all, and its not like it takes any extra thought or effort to chdir to a start dir you depend on, its the most basic of good portability practices , dont assume a cwd, ensure the cwd you depend on is the one you want

    Its right up there with not assuming you can have "_build" and "_BUILD" in the same directory

    Its right up there with not assuiming a /tmp... and using  File::Spec -> tmpdir or File::Temp::newdir

      Its right up there with not assuiming a /tmp... and using File::Spec -> tmpdir or File::Temp::newdir

      Heh. Tell Perl that. Turns out that one of the few places that creates temporary files but just hard-codes "/tmp" is some cruft C code inside Perl. Sadly, Plack chose to use that.

      (And, yes, I agree with you.)

      - tye