Test-nginx doesn't work

I’ve put test-nginx into a test directory, but it shows can’t locate
socket.pm. Do I need to install TEST::NGINX into perl lib directory?

ll test

总用量 60
drwxr-xr-x 5 root root 4096 2012-01-01 08:00 ./
drwxr-xr-x 5 simon simon 4096 2012-01-13 17:31 …/
-rw-r–r-- 1 root root 8018 2012-01-01 08:00 Changes
-rw-r–r-- 1 root root 298 2012-01-01 08:00 .gitignore
drwxr-xr-x 4 root root 4096 2012-01-01 08:00 inc/
drwxr-xr-x 3 root root 4096 2012-01-01 08:00 lib/
-rw-r–r-- 1 root root 758 2012-01-01 08:00 Makefile.PL
-rw-r–r-- 1 root root 749 2012-01-01 08:00 MANIFEST
-rw-r–r-- 1 root root 303 2012-01-01 08:00 MANIFEST.SKIP
-rw-r–r-- 1 root root 867 2012-01-01 08:00 META.yml
-rw-r–r-- 1 root root 9851 2012-01-01 08:00 README
drwxr-xr-x 2 root root 4096 2012-01-01 08:00 t/

prove -r t/apply_moves.t

t/apply_moves.t … Can’t locate Test/Nginx/Socket.pm in @INC (@INC
contains: /etc/perl /usr/local/lib/perl/5.10.1
/usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5
/usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at
t/apply_moves.t line 2.
BEGIN failed–compilation aborted at t/apply_moves.t line 2.
t/apply_moves.t … Dubious, test returned 2 (wstat 512, 0x200)
No subtests run

Test Summary Report

t/apply_moves.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
Files=1, Tests=0, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
Result: FAIL

Posted at Nginx Forum:

Hi,

prove -r t/apply_moves.t

prove -I lib -r t

Best regards,
Piotr S. < [email protected] >

On Fri, Jan 13, 2012 at 5:52 PM, bigplum [email protected] wrote:

I’ve put test-nginx into a test directory, but it shows can’t locate
socket.pm. Do I need to install TEST::NGINX into perl lib directory?

You need to

  1. install Test::Nginx into your perl installation by running the
    following commands on shell:

    perl Makefile.PL
    make
    make install

In case that you have multiple perl installations in your system,
please ensure that you’re using the right perl.

  1. specify the location of Test::Nginx’s lib/ directory in your
    “prove” command line (just as Piotr S. has pointed out), that is

    prove -I/path/to/Test-Nginx/lib -r t

Regards,
-agentzh

It’s OK now by refering to agentzh’s steps. thanks all.

Additionally, maybe it’s useful to set ftp mode before running “make”:

export BM_UPLOAD_FTP_PASSIVE=“true”

otherwise this error would occur:

*** Installing dependencies…
Can’t use an undefined value as a symbol reference at
/usr/share/perl/5.10/Net/FTP/dataconn.pm line 54.
Compilation failed in require at inc/Module/Install/AutoInstall.pm line
37.

Posted at Nginx Forum: