Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: darrell [...] sirsi.com
Cc:
AdminCc:

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



Subject: Patch to 'prove' Script Found on CPAN
Date: Tue, 23 Mar 2004 18:02:17 -0600
From: "Darrell Gammill" <darrell [...] sirsi.com>
To: <andy [...] petdance.com>
I have a suggested change to 'prove' which I found listed with Test::Harness 2.40 on CPAN. This address differences in how Windows processes wild card characters in command line arguments verse UNIX. In UNIX, something like 'prove t/*.t' has the wildcard filenames expanded before passing them to the program. So, if t has two file, test1.t and test2.t, the command executed is as follows: prove t/test1.t t/test2.t In Windows, the wildcard is not expanded and the program is faced with something like 'open(FH, "</t*.t");' which fails. The workaround I have found works, at least in Active State's perl 5.6.1 is to 'glob' the elements of @ARGV and push the results into a separate list. the change to prove would be as follows: As reads: my @tests; @ARGV = File::Spec->curdir unless @ARGV; push( @tests, -d $_ ? all_in( $_ ) : $_ ) for @ARGV; Should read: my (@tests, @file_list); @ARGV = File::Spec->curdir unless @ARGV; foreach (@ARGV) { push @file_list, glob; } push( @tests, -d $_ ? all_in( $_ ) : $_ ) for @file_list; There maybe better ways of doing it. There are probably options I missed. If either is true, let me know. I would be interested in seeing them. Tnx, Dgg BTW: I noticed Rocco Caputo has posted an update to Test::Harness on CPAN last February since your update last December. Can there be multiple maintainers? Is this a late arrival? I'm still trying to get a handle on this CPAN thing. Tnx Darrell Gammill System Support Specialist darrell@sirsi.com
Show quoted text
> my (@tests, @file_list); > @ARGV = File::Spec->curdir unless @ARGV; > foreach (@ARGV) { push @file_list, glob; } > push( @tests, -d $_ ? all_in( $_ ) : $_ ) for @file_list;
I redid as push( @tests, -d $_ ? all_in( $_ ) : $_ ) for map { glob } @ARGV; This patch is made in 2.41_01, which I hope to release tonight.