in reply to Local library for module test script

During 'make test' the current working directory is the top-level folder ... so I'm thinking you want require './t/lib.pm';.
Best to check that on your own machine before uploading to CPAN.

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: Local library for module test script
by Anonymous Monk on Dec 03, 2014 at 03:38 UTC

    cwd can change, best not to rely on it at all ... I'm frequently inside cwd() of "t" when trying to fix/debug some module, so relying on require "./t/..." would fail

    I also often do perl dist-name-version/t/foo.t :) relying on cwd is weak sauce, it can work very often, but its weak practice

      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
        Well I often have individual tests open in my editor and run them with F5.

        Cheers Rolf

        (addicted to the Perl Programming Language and ☆☆☆☆ :)

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