Mail Archives: cygwin/2005/07/19/08:45:46
On Mon, 18 Jul 2005 01:50:33 -0700, Michael G Schwern wrote:
>
> MakeMaker is not involved, just Test::Harness. All the action is in or
> called from Test::Harness::Straps->analyze_file.
I agree. TH is resetting INC and the directories passed
into test_harness() are lost after the first invocation.
The simple test script below, when tested twice, fails on
the second call. As you'll see, blib/lib is not in INC.
_____ t/foo.t
/ #!/usr/bin/perl -w
| use strict;
| use Test::More qw(no_plan);
|
| use_ok('Device::Profile::Document');
| printf("INC:\t%s\n", join("\n\t", @INC));
If you prepend the perl or (make test) command with
(env PERL5LIB=blib/lib) the tests will work.
% perl -MExtUtils::Command::MM -e 'test_harness(1, "blib/lib")' t/foo.t t/foo.t
t/foo....ok 1 - use Device::Profile::Document;
INC: /home/scott/Projects/MDS2/Device-Profile/blib/lib
/usr/lib/perl5/5.8/cygwin
/usr/lib/perl5/5.8
/usr/lib/perl5/site_perl/5.8/cygwin
/usr/lib/perl5/site_perl/5.8
/usr/lib/perl5/site_perl/5.8
/usr/lib/perl5/vendor_perl/5.8/cygwin
/usr/lib/perl5/vendor_perl/5.8
/usr/lib/perl5/vendor_perl/5.8
.
1..1
ok
t/foo....
# Failed test (t/foo.t at line 5)
# Tried to use 'Device::Profile::Document'.
# Error: Can't locate Device/Profile/Document.pm in @INC (@INC contains: /usr/lib/perl5/5.8/cygwin /usr/lib/perl5/5.8 /usr/lib/perl5/site_perl/5.8/cygwin /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_perl/5.8/cygwin /usr/lib/perl5/vendor_perl/5.8 /usr/lib/perl5/vendor_perl/5.8 .) at (eval 3) line 2.
# BEGIN failed--compilation aborted at t/foo.t line 5.
# Looks like you failed 1 test of 1.
not ok 1 - use Device::Profile::Document;
INC: /usr/lib/perl5/5.8/cygwin
/usr/lib/perl5/5.8
/usr/lib/perl5/site_perl/5.8/cygwin
/usr/lib/perl5/site_perl/5.8
/usr/lib/perl5/site_perl/5.8
/usr/lib/perl5/vendor_perl/5.8/cygwin
/usr/lib/perl5/vendor_perl/5.8
/usr/lib/perl5/vendor_perl/5.8
.
1..1
dubious
Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 1
Failed 1/1 tests, 0.00% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/foo.t 1 256 1 1 100.00% 1
Failed 1/2 test scripts, 50.00% okay. 1/2 subtests failed, 50.00% okay.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -