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;