Skip Menu |

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

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

People
Owner: andy [...] hexten.net
Requestors: michael_lee_squires [...] pobox.com
Cc:
AdminCc:

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



Subject: prove mungs paths in mixed cygwin / win32 environments
*** /usr/bin/prove Mon Jul 30 03:48:33 2007 --- prove Thu Sep 6 17:43:30 2007 *************** *** 79,84 **** --- 79,106 ---- @ARGV = File::Spec->curdir unless @ARGV; my @argv_globbed; my @tests; + # + # On Windows systems with cygwin installed, there are times + # when you are running a mixed set of windows apps and cygwin + # apps. For example, Eclipse is a "windows" app, but "prove" is a + # cygwin (via the cygwin perl) app. So windows tools will generate + # paths as "c:\michael\projects\foo.t" and hand them to prove to + # work on. The File::Spec stuff understands both formats and will do + # the right thing. However, File::Glob::bsd_glob is set up to treat + # backslashes as metacharacter indications, so it silently eats the + # backslashes, making the path unusable. + # + # A local workaround for my use case (doing a "prove" on a single test + # file) is to use File::Spec->canonpath to convert the backslash path + # to a "real (unix)" path. :) But this obviously isn't a general solution. + # + # <KLUDGE> + my $idx; + for($idx=0;$idx<scalar(@ARGV);$idx++) { + $ARGV[$idx] = File::Spec->canonpath($ARGV[$idx]); + } + # </KLUDGE> + if ( $] >= 5.006001 ) { require File::Glob; @argv_globbed = map { File::Glob::bsd_glob($_) } @ARGV;
This works for absolute paths with no wildcard in Test::Harness 3.00 and higher: $ prove 'C:\Cygwin\home\administrator\Works\Perl\TAPx-Parser\tapx\trunk\t\000-load.t' C:\Cygwin\home\administrator\Works\Perl\TAPx-Parser\tapx\trunk\t\000-load......1/56 # Testing Test::Harness 3.02, Perl 5.008008, /usr/bin/perl.exe C:\Cygwin\home\administrator\Works\Perl\TAPx-Parser\tapx\trunk\t\000-load......ok All tests successful. Files=1, Tests=56, 0 wallclock secs ( 0.00 usr 0.06 sys + 0.08 cusr 0.28 csys = 0.42 CPU) Result: PASS Wildcards are not expanded though. Is that OK for Eclipse use?