Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-Id: <200507191245.j6JCjAcS080629@crag.niss.com>
From: Scott Bolte <listS+cygwin@niss.com>
To: Michael G Schwern <schwern@pobox.com>
cc: "Gerrit P. Haase" <gerrit@familiehaase.de>, Andrew Ho <andrew@tellme.com>,
   cygwin@cygwin.com, makemaker@perl.org, perl5-porters@perl.org,
   petdance@cpan.org
Subject: Re: [perl-5.8.7] Perl regression tests fail when lib directory is present
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <80627.1121777110.1@crag.niss.com>
Date: Tue, 19 Jul 2005 07:45:10 -0500
X-IsSubscribed: yes

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/

