root/t/spec/fudgeall

Revision 20869, 0.8 kB (checked in by deven, 7 months ago)

Added quotes in case fudge path has spaces. (Tested on Linux and Win32 with Strawberry Perl environment, reviewed by Patrick Michaud and Jerry Gay.)

  • Property svn:mime-type set to text/plain; charset=UTF-8
  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6my @opts;
7while( $_ = $ARGV[0], /^-/ ) {
8    shift;
9    last if /^--$/;
10    push @opts, $_;
11}
12
13my $platform = shift;
14
15use Cwd;
16my $top = getcwd;
17my $fudge;
18
19TOP:
20while ($top) {
21    for ("$top/fudge",
22        "$top/spec/fudge",
23        "$top/t/spec/fudge",
24        "$top/perl6/t/spec/fudge",
25        "$top/languages/perl6/t/spec/fudge",
26    ) {
27        if (-f $_) {
28            $fudge = $_;
29            last TOP;
30        }
31    }
32    $top =~ s!(.*)/(.*)!!;
33}
34if (not $fudge) {
35    for (split(/[:;]/, $ENV{PATH})) {
36        if (-f "$_/fudge") {
37            $fudge = "$_/fudge";
38            last;
39        }
40    }
41}
42
43print join(' ',
44    map {
45        my $pick;
46        if ( $_ !~ m/\.$platform$/ ) {
47            my $cmd = "$^X \"$fudge\" @opts $platform $_";
48            chomp( $pick = `$cmd` );
49        }
50        defined $pick ? $pick : ();
51    } @ARGV
52), "\n";
53
Note: See TracBrowser for help on using the browser.