Krishnom
Krishnom

Reputation: 1446

Running perl test in intellij: Can't load module PassEnv at

I want to created perl modules in intellij derived by Tests. I created following test in a new project as shown below

#!/usr/bin/perl
use strict;
use warnings;
use Test::More;

done_testing();

But when i am trying to run the test (Shift+Alt+F10), it fails with below error

Testing started at 10:51 ... C:/Strawberry/perl/bin\perl.exe C:/Strawberry/perl/bin/prove.bat -PPassEnv --formatter TAP::Formatter::Camelcade --merge --recurse --jobs 1 D:/workspace/code/repo/Modules/ImageUtilities/ReaConverterTest.t Can't load module PassEnv at C:/Strawberry/perl/bin/prove.bat line 26.
Process finished with exit code 2

But when I run the test from the command line it works fine

$ perl -w ReaConverterTest.t
1..0

I see that there was an issue reported with intellij perl plugin(https://github.com/Camelcade/Perl5-IDEA/issues/1966) but it is closed. Looks like it was fixed in 2019.1 Perl but I am clueless why it's failing for me.

Any idea on how to fix this?

PS: I am using Git-Bash to run Perl scripts, IntelliJ using strawberry Perl installation on windows as Perl interpreter.


Update

When i run the script by adding "use PassEnv" it fails as there is no such module Searching from intellij also results in "no such module"

perl -w ReaConverter.t
Can't locate PassEnv.pm in @INC (you may need to install the PassEnv module) (@INC contain
s: /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/sha
re/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl) at ReaConverter.
t line 6.
BEGIN failed--compilation aborted at ReaConverter.t line 6.

Upvotes: 3

Views: 1451

Answers (1)

ikegami
ikegami

Reputation: 385764

Because of the -PPassEnv option used, prove attempts to load App::Prove::Plugin::PassEnv. It hasn't been installed. Simply install the module.

Note: You want to install it using Strawberry Perl, so the following appears to be the appropriate command from your preferred shell:

/c/Strawberry/perl/bin/cpanm App::Prove::Plugin::PassEnv

Upvotes: 3

Related Questions