This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [perl-5.8.7] Perl regression tests fail when lib directory is present


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]