Giter Site home page Giter Site logo

Comments (2)

thaljef avatar thaljef commented on June 11, 2024

Unlike your other unit tests, Test::Perl::Critic doesn't actually load any of your libraries; it just sees them as files. So T::P::C doesn't need to have the same module environment as your libraries. So unless I misunderstand the gist of your request, I think you can already do what you want. You just have to invoke the T::P::C test script separately.

from test-perl-critic.

iynehz avatar iynehz commented on June 11, 2024

@thaljef Let me explain it in more details.

At my workplace Perl modules are not located naturally, and basically every package has a different lib path. The Perl interpreter by default does not see any non-core modules. When I test my library, I need to explicitly manipulate @INC, like hardcoding use lib in my test files, or more generically via prove's -I option or changing PERL5LIB, to specify the exact locations of my library dependencies. And those lib paths are my test dependencies.

Now I am re-engineering DZIL for my workplace as an internal build tool for Perl projects. With that thing I have Dist::Zilla::Plugin::Test::Perl::Critic for generating an additional test file that calls T::P::C. But because of the special environment as I explained above, when I "prove" this T::P::C test file, I will also need to explicitly inject T::P::C's dependencies, as otherwise the test file cannot run. If I don't re-engineer Dist::Zilla::Plugin::Test::Perl::Critic to change the auto-generated test file, then I would need to add dependencies of T::P::C into prove's -I option or PERL5LIB. But that change is possible to affect all test files, including my library's own test files.

As indicated above, an alternative approach for me can be to re-engineer Dist::Zilla::Plugin::Test::Perl::Critic to hack its generated test file. But as our perlcritic is already re-engineered, it would be great if T::P::C itself can support external perlciritic.

from test-perl-critic.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.