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

cwd can change Sure, and I have no objection to the approach you suggested. However, I write my test suites under the assumption that they're going to be run from "one directory up". If someone complained that they couldn't be run from the 't' directory then I'd likely suggest "stop doing that". Cheers, Rob

:) I wouldn't complain to the author, but I would be slightly annoyed and think to myself the author must be an assumer that doesn't understand portability ;)

In your case syphilis it wouldn't shape my opinion of your skills/care/personality, but for authors I'm less familiar with, it would be something I'd remember :) not give much weight to, but, its a quip :)

  • Comment on Re^4: Local library for module test script

Replies are listed 'Best First'.
Re^5: Local library for module test script
by syphilis (Archbishop) on Dec 03, 2014 at 12:40 UTC
    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

      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

      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