Skip Menu |

This queue is for tickets about the Test-Harness CPAN distribution.

Report information
The Basics
Id: 6452
Status: resolved
Priority: 0/
Queue: Test-Harness

People
Owner: Nobody in particular
Requestors: fj [...] raremedium.net
jdhedden [...] 1979.usna.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.42
Fixed in: (no value)



Subject: t/prove-switches fails under Cygwin
Under Cygwin using Perl 5.8.4, 'make test' produces: cp bin/prove blib/script/prove /usr/local/bin/perl.exe "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/prove /usr/local/bin/perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00compile.........# Testing Test::Harness 2.42 t/00compile.........ok t/assert............ok t/base..............ok t/callback..........ok t/inc_taint.........ok t/nonumbers.........ok t/ok................ok t/pod...............skipped all skipped: Test::Pod 1.00 required for testing POD t/prove-globbing....ok t/prove-switches....ok 3/5# Failed test (t/prove-switches.t at line 56) # Structures begin differing at: # $got->[0] = '# $Test::Harness::Switches: -Ilib -Iblib/arch -Iblib/lib -Ifark -Ibongo # ' # $expected->[0] = '# $Test::Harness::Switches: -Ilib -Ibongo # ' t/prove-switches....NOK 4# Failed test (t/prove-switches.t at line 64) # Structures begin differing at: # $got->[0] = '# $Test::Harness::Switches: -Ilib -Iblib/arch -Iblib/lib -Ifark # ' # $expected->[0] = '# $Test::Harness::Switches: -Ilib -Iblib/arch -Iblib/lib # ' # Looks like you failed 2 tests of 5. t/prove-switches....dubious Test returned status 2 (wstat 512, 0x200) DIED. FAILED tests 4-5 Failed 2/5 tests, 60.00% okay t/strap-analyze.....ok t/strap.............ok t/test-harness......ok 56/208 skipped: various reasons Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/prove-switches.t 2 512 5 2 40.00% 4-5 1 test and 56 subtests skipped. Failed 1/13 test scripts, 92.31% okay. 2/537 subtests failed, 99.63% okay. make: *** [test_dynamic] Error 14
Subject: "prove switch" test error, install failures in cygwin

Message body is not shown because it is too large.

From: Steve Peters
There appears to be an issue with the blocks in the code. I don't know if this is related to Test::Harness alone, or if this is a Cygwin Perl bug. I added the following line to the end of the block called "PROVE_SWITCHES" and it worked just fine. undef $ENV{PROVE_SWITCHES};
Date: Thu, 22 Jul 2004 17:26:35 -0500
From: Andy Lester <andy [...] petdance.com>
To: via RT <bug-Test-Harness [...] rt.cpan.org>
CC: undisclosed-recipients: ;
Subject: Re: [cpan #6452] t/prove-switches fails under Cygwin
RT-Send-Cc:
On Thu, Jul 22, 2004 at 06:01:23PM -0400, via RT (bug-Test-Harness@rt.cpan.org) wrote: Show quoted text
> There appears to be an issue with the blocks in the code. I don't know > if this is related to Test::Harness alone, or if this is a Cygwin Perl > bug. I added the following line to the end of the block called > "PROVE_SWITCHES" and it worked just fine. > > undef $ENV{PROVE_SWITCHES};
Can you please try the following program under Cygwin for me: #!/usr/bin/perl -w use warnings; use strict; my $key = "WANGO"; BLOCK1: { my $val = $ENV{$key}; $val = "undef" unless defined $val; print "In BLOCK1, \$ENV{$key} = [$val]\n"; } BLOCK2: { local $ENV{$key} = "FOTANGO"; my $val = $ENV{$key}; $val = "undef" unless defined $val; print "In BLOCK2, \$ENV{$key} = [$val]\n"; } BLOCK3: { my $val = $ENV{$key}; $val = "undef" unless defined $val; print "In BLOCK3, \$ENV{$key} = [$val]\n"; print " ... BUT IT SHOULD BE undef!" unless $val eq "undef"; } === cut === The output I get is: In BLOCK1, $ENV{WANGO} = [undef] In BLOCK2, $ENV{WANGO} = [FOTANGO] In BLOCK3, $ENV{WANGO} = [undef] What do you get? xoa -- Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance
From: Steve Peters
Well, I'm confused. I got what we expected... $ ./test.pl In BLOCK1, $ENV{WANGO} = [undef] In BLOCK2, $ENV{WANGO} = [FOTANGO] In BLOCK3, $ENV{WANGO} = [undef]
From: Steve Peters
OK, I tried something similar to what is above, but made some changes to make it more similar to the actual test. #!/usr/bin/perl -w use warnings; use strict; my $key = "WANGO"; BLOCK1: { my $val = $ENV{$key}; $val = "undef" unless defined $val; print "In BLOCK1, \$ENV{$key} = [$val]\n"; } BLOCK2: { local $ENV{$key} = "FOTANGO"; my $val = $ENV{$key}; $val = "undef" unless defined $val; print "In BLOCK2, \$ENV{$key} = [$val]\n"; } BLOCK3: { my $val = qx/test2.pl/; $val = "undef" unless defined $val; print "In BLOCK3, \$ENV{$key} = [$val]\n"; print " ... BUT IT SHOULD BE undef!" unless $val eq "undef"; } =cut test2.pl #!/usr/bin/perl -w use strict; my $val = $ENV{WANGO}; $val = "undef" if ! defined $val; print $val; =cut Now, my results on Cygwin are... In BLOCK1, $ENV{WANGO} = [undef] In BLOCK2, $ENV{WANGO} = [FOTANGO] In BLOCK3, $ENV{WANGO} = [FOTANGO] ... BUT IT SHOULD BE undef! On Linux (Perl 5.8.2 on Gentoo with a 2.4.26 kernel) are... In BLOCK1, $ENV{WANGO} = [undef] In BLOCK2, $ENV{WANGO} = [FOTANGO] In BLOCK3, $ENV{WANGO} = [undef] I tested this out on Win32(Perl 5.8.3) and HP-UX (Perl 5.8.3) also, and it behaves as expected. My guess is that this is a Cygwin issue rather than a Perl one, but I'd have to dig a bit more to be sure. This might be a good P5P question.
Added a fudge of $ENV{PROVE_SWITCHES} for Cygwin only.