Comments (2)
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.
@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)
- Please make the MCE dependency optional HOT 12
- Perl::Critic being instantiated for each file is very slow HOT 2
- wishlist: Option to allow excluding some files HOT 1
- Test::Builder needs to be at least version 0.88
- Fresh install fails to install PPI because of missing File::Remove dependency HOT 2
- [libtest-perl-critic-perl] lintian FTBFS with new version HOT 5
- should require newer version of MCE HOT 1
- Issues link in POD is wrong HOT 3
- Wishlist: better use of PPI::Cache
- critic_ok() in xt/96_perlcritic.t doesn't work with MCE running HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from test-perl-critic.