[svn:parrot] r42947 - trunk/tools/install

fperrad at svn.parrot.org fperrad at svn.parrot.org
Tue Dec 8 20:13:49 UTC 2009


Author: fperrad
Date: Tue Dec  8 20:13:48 2009
New Revision: 42947
URL: https://trac.parrot.org/parrot/changeset/42947

Log:
[install] attempt to fix TT #1360

Modified:
   trunk/tools/install/smoke.pl
   trunk/tools/install/smoke_languages.pl

Modified: trunk/tools/install/smoke.pl
==============================================================================
--- trunk/tools/install/smoke.pl	Tue Dec  8 13:35:02 2009	(r42946)
+++ trunk/tools/install/smoke.pl	Tue Dec  8 20:13:48 2009	(r42947)
@@ -60,23 +60,30 @@
 
 chdir $DESTDIR if ($DESTDIR);
 
+sub quote {
+    my $exe = shift;
+    $exe .= '.exe' if ($^O eq 'MSWin32');
+    $exe = '"' . $exe . '"' if ($exe =~ / /);
+    return $exe;
+}
+
 my $filename;
 my $exe;
 my $out;
 my $FH;
-my $parrot = catfile($bindir, 'parrot');
-my $pirc = catfile($bindir, 'pirc');
-my $nqp = catfile($bindir, 'parrot-nqp');
+my $parrot = quote(catfile($bindir, 'parrot'));
+my $pirc = quote(catfile($bindir, 'pirc'));
+my $nqp = quote(catfile($bindir, 'parrot-nqp'));
 
 #
 # parrot executable
 #
 
-$exe = catfile($bindir, 'pbc_merge');
+$exe = quote(catfile($bindir, 'pbc_merge'));
 $out = `$exe`;
 ok($out =~ /^pbc_merge/, "check pbc_merge");
 
-$exe = catfile($bindir, 'pbc_dump');
+$exe = quote(catfile($bindir, 'pbc_dump'));
 $out = `$exe`;
 ok($out =~ /^pbc_dump/, "check pbc_dump");
 

Modified: trunk/tools/install/smoke_languages.pl
==============================================================================
--- trunk/tools/install/smoke_languages.pl	Tue Dec  8 13:35:02 2009	(r42946)
+++ trunk/tools/install/smoke_languages.pl	Tue Dec  8 20:13:48 2009	(r42947)
@@ -62,11 +62,18 @@
 chdir($DESTDIR) if ($DESTDIR);
 my $pwd = getcwd();
 
+sub quote {
+    my $exe = shift;
+    $exe .= '.exe' if ($^O eq 'MSWin32');
+    $exe = '"' . $exe . '"' if ($exe =~ / /);
+    return $exe;
+}
+
 my $filename;
 my $exe;
 my $out;
 my $FH;
-my $parrot = catfile($pwd, $bindir, 'parrot');
+my $parrot = quote(catfile($pwd, $bindir, 'parrot'));
 
 $out = `$parrot -V`;
 $out =~ m/version (\S+) built/;
@@ -82,15 +89,14 @@
 
 SKIP:
 {
-skip("abc", 1) unless (-d "$pwd/$langdir/abc");
+$exe = quote(catfile($pwd, $bindir, 'parrot-abc'));
+skip("abc", 1) unless (-d "$pwd/$langdir/abc" || -e $exe);
 chdir("$pwd/$langdir/abc");
 $filename = 'test.bc';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "1 + 2\n";
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-abc');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot abc.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "3\n", "check abc");
@@ -99,7 +105,8 @@
 
 SKIP:
 {
-skip("Befunge", 1) unless (-d "$pwd/$langdir/befunge");
+$exe = quote(catfile($pwd, $bindir, 'parrot-befunge'));
+skip("Befunge", 1) unless (-d "$pwd/$langdir/befunge" || -e $exe);
 chdir("$pwd/$langdir/befunge");
 $filename = 'test.bef';
 open $FH, '>', $filename
@@ -117,8 +124,6 @@
                  > :8- ^
 CODE
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-befunge');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot befunge.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "If you can see a 4 here ->4 <- then everything is ok!\n", "check befunge");
@@ -127,20 +132,17 @@
 
 SKIP:
 {
-skip("bf", 3) unless (-d "$pwd/$langdir/bf");
+$exe = quote(catfile($pwd, $bindir, 'parrot-bf'));
+skip("bf", 3) unless (-d "$pwd/$langdir/bf" || -e $exe);
 chdir("$pwd/$langdir/bf");
-$exe = catfile($pwd, $bindir, 'parrot-bf');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot bf.pbc" unless (-e $exe);
 $out = `$exe`;
 ok($out =~ /^usage/, "check bf");
-$exe = catfile($pwd, $bindir, 'parrot-bfc');
-$exe .= '.exe' if ($^O eq 'MSWin32');
+$exe = quote(catfile($pwd, $bindir, 'parrot-bfc'));
 $exe = "$parrot bfc.pbc" unless (-e $exe);
 $out = `$exe`;
 ok($out =~ /^usage/, "check bfc");
-$exe = catfile($pwd, $bindir, 'parrot-bfco');
-$exe .= '.exe' if ($^O eq 'MSWin32');
+$exe = quote(catfile($pwd, $bindir, 'parrot-bfco'));
 $exe = "$parrot bfco.pbc" unless (-e $exe);
 $out = `$exe`;
 ok($out =~ /^usage/, "check bfco");
@@ -157,13 +159,12 @@
 else {
     skip("blizkost", 1)
 }
+$exe = quote(catfile($pwd, $bindir, 'parrot-blizkost'));
 $filename = 'test.pl';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "print qq{Hello, World!\n};\n";
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-blizkost');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot perl5.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello, World!\n" || $out eq "Hello, World!\r\n", "check blizkost");
@@ -172,10 +173,9 @@
 
 SKIP:
 {
-skip("Cardinal", 1) unless (-d "$pwd/$langdir/cardinal");
+$exe = quote(catfile($pwd, $bindir, 'parrot-cardinal'));
+skip("Cardinal", 1) unless (-d "$pwd/$langdir/cardinal" || -e $exe);
 chdir("$pwd/$langdir/cardinal");
-$exe = catfile($pwd, $bindir, 'parrot-cardinal');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot cardinal.pbc" unless (-e $exe);
 $out = `$exe -e "print 'hello world';"`;
 ok($out eq "hello world", "check cardinal");
@@ -183,15 +183,14 @@
 
 SKIP:
 {
-skip("ChitChat", 1) unless (-d "$pwd/$langdir/chitchat");
+$exe = quote(catfile($pwd, $bindir, 'parrot-chitchat'));
+skip("ChitChat", 1) unless (-d "$pwd/$langdir/chitchat" || -e $exe);
 chdir("$pwd/$langdir/chitchat");
 $filename = 'test.smalltalk';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "Transcript show: 'Hello, world!'.";
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-chitchat');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot chitchat.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello, world!\n", "check chitchat");
@@ -208,15 +207,14 @@
 
 SKIP:
 {
-skip("EcmaScript", 1) unless (-d "$pwd/$langdir/ecmascript");
+$exe = quote(catfile($pwd, $bindir, 'parrot-js'));
+skip("EcmaScript", 1) unless (-d "$pwd/$langdir/ecmascript" || -e $exe);
 chdir("$pwd/$langdir/ecmascript");
 $filename = 'test.js';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "print(\"Hello World from JS\");";
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-js');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot js.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello World from JS\n", "check ecmascript");
@@ -225,15 +223,14 @@
 
 SKIP:
 {
-skip("fun", 1) unless (-d "$pwd/$langdir/fun");
+$exe = quote(catfile($pwd, $bindir, 'parrot-fun'));
+skip("fun", 1) unless (-d "$pwd/$langdir/fun" || -e $exe);
 chdir("$pwd/$langdir/fun");
 $filename = 'test.fun';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "\"Hello World!\".";
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-fun');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot fun.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello World!\n", "check fun");
@@ -242,15 +239,14 @@
 
 SKIP:
 {
-skip("gil", 1) unless (-d "$pwd/$langdir/gil");
+$exe = quote(catfile($pwd, $bindir, 'parrot-gil'));
+skip("gil", 1) unless (-d "$pwd/$langdir/gil" || -e $exe);
 chdir("$pwd/$langdir/gil");
 $filename = 'test.gil';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH q{say('Hello, world!');};
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-gil');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot gil.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello, world!\n", "check gil");
@@ -259,15 +255,14 @@
 
 SKIP:
 {
-skip("HQ9Plus", 1) unless (-d "$pwd/$langdir/hq9plus");
+$exe = quote(catfile($pwd, $bindir, 'parrot-hq9plus'));
+skip("HQ9Plus", 1) unless (-d "$pwd/$langdir/hq9plus" || -e $exe);
 chdir("$pwd/$langdir/hq9plus");
 $filename = 'test.HQ9Plus';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "H";
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-hq9plus');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot hq9plus.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello, world!\n", "check HQ9Plus");
@@ -276,15 +271,14 @@
 
 SKIP:
 {
-skip("Lisp", 1) unless (-d "$pwd/$langdir/lisp");
+$exe = quote(catfile($pwd, $bindir, 'parrot-lisp'));
+skip("Lisp", 1) unless (-d "$pwd/$langdir/lisp" || -e $exe);
 chdir("$pwd/$langdir/lisp");
 $filename = 'test.l';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "( print \"Hello, World!\" )\n";
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-lisp');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot lisp.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello, World!\n", "check lisp");
@@ -293,7 +287,8 @@
 
 SKIP:
 {
-skip("LOLCODE", 1) unless (-d "$pwd/$langdir/lolcode");
+$exe = quote(catfile($pwd, $bindir, 'parrot-lolcode'));
+skip("LOLCODE", 1) unless (-d "$pwd/$langdir/lolcode" || -e $exe);
 chdir("$pwd/$langdir/lolcode");
 $filename = 'test.lolcode';
 open $FH, '>', $filename
@@ -304,8 +299,6 @@
 KTHXBYE
 CODE
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-lolcode');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot lolcode.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "HAI WORLD!\n", "check lolcode");
@@ -314,10 +307,9 @@
 
 SKIP:
 {
-skip("Lua", 1) unless (-d "$pwd/$langdir/lua");
+$exe = quote(catfile($pwd, $bindir, 'parrot-lua'));
+skip("Lua", 1) unless (-d "$pwd/$langdir/lua" || -e $exe);
 chdir("$pwd/$langdir/lua");
-$exe = catfile($pwd, $bindir, 'parrot-lua');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot lua.pbc" unless (-e $exe);
 $out = `$exe -e "print(nil)"`;
 ok($out eq "nil\n", "check lua");
@@ -325,10 +317,9 @@
 
 SKIP:
 {
-skip("m4", 1) unless (-d "$pwd/$langdir/m4");
+$exe = quote(catfile($pwd, $bindir, 'parrot-m4'));
+skip("m4", 1) unless (-d "$pwd/$langdir/m4" || -e $exe);
 chdir("$pwd/$langdir/m4");
-$exe = catfile($pwd, $bindir, 'parrot-m4');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot m4.pbc" unless (-e $exe);
 $out = `$exe`;
 ok($out =~ /^Usage/, "check m4");
@@ -336,15 +327,14 @@
 
 SKIP:
 {
-skip("Markdown", 1) unless (-d "$pwd/$langdir/markdown");
+$exe = quote(catfile($pwd, $bindir, 'parrot-markdown'));
+skip("Markdown", 1) unless (-d "$pwd/$langdir/markdown" || -e $exe);
 chdir("$pwd/$langdir/markdown");
 $filename = 'test.text';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "Hello, World!\n\n";
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-markdown');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot markdown.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "<p>Hello, World!</p>\n", "check markdown");
@@ -353,15 +343,14 @@
 
 SKIP:
 {
-skip("matrixy", 1) unless (-d "$pwd/$langdir/matrixy");
+$exe = quote(catfile($pwd, $bindir, 'parrot-matrixy'));
+skip("matrixy", 1) unless (-d "$pwd/$langdir/matrixy" || -e $exe);
 chdir("$pwd/$langdir/matrixy");
 $filename = 'test.oct';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "printf(\"Hello, world!\n\");";
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-matrixy');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot matrixy.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello, world!\n", "check matrixy");
@@ -370,15 +359,14 @@
 
 SKIP:
 {
-skip("Paraplegic", 1) unless (-d "$pwd/$langdir/paraplegic");
+$exe = quote(catfile($pwd, $bindir, 'parrot-apl'));
+skip("Paraplegic", 1) unless (-d "$pwd/$langdir/paraplegic" || -e $exe);
 chdir("$pwd/$langdir/paraplegic");
 $filename = 'test.apl';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "\"Hello world!\"";
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-apl');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot apl.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello world!\n", "check Paraplegic");
@@ -387,15 +375,14 @@
 
 SKIP:
 {
-skip("Pheme", 1) unless (-d "$pwd/$langdir/pheme");
+$exe = quote(catfile($pwd, $bindir, 'parrot-pheme'));
+skip("Pheme", 1) unless (-d "$pwd/$langdir/pheme" || -e $exe);
 chdir("$pwd/$langdir/pheme");
 $filename = 'test.l';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "( write \"Hello, World!\\n\" )\n";
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-pheme');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot pheme.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello, World!\n", "check pheme");
@@ -404,15 +391,14 @@
 
 SKIP:
 {
-skip("Pipp", 1) unless (-d "$pwd/$langdir/pipp");
+$exe = quote(catfile($pwd, $bindir, 'parrot-pipp'));
+skip("Pipp", 1) unless (-d "$pwd/$langdir/pipp" || -e $exe);
 chdir("$pwd/$langdir/pipp");
 $filename = 'test.php';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "<?php echo \"Hello, World!\\n\"; ?>";
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-pipp');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot pipp.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello, World!\n", "check pipp");
@@ -421,7 +407,8 @@
 
 SKIP:
 {
-skip("porcupine", 1) unless (-d "$pwd/$langdir/porcupine");
+$exe = quote(catfile($pwd, $bindir, 'parrot-porcupine'));
+skip("porcupine", 1) unless (-d "$pwd/$langdir/porcupine" || -e $exe);
 chdir("$pwd/$langdir/porcupine");
 $filename = 'test.pas';
 open $FH, '>', $filename
@@ -433,8 +420,6 @@
 end.
 CODE
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-porcupine');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot porcupine.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello, world!\n", "check porcupine");
@@ -443,15 +428,14 @@
 
 SKIP:
 {
-skip("primitivearc", 1) unless (-d "$pwd/$langdir/primitivearc");
+$exe = quote(catfile($pwd, $bindir, 'parrot-primitivearc'));
+skip("primitivearc", 1) unless (-d "$pwd/$langdir/primitivearc" || -e $exe);
 chdir("$pwd/$langdir/primitivearc");
 $filename = 'test.arc';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH q{"Hello, world!\n"};
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-primitivearc');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot primitivearc.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello, world!\n\n", "check primitivearc");
@@ -460,15 +444,14 @@
 
 SKIP:
 {
-skip("Punie", 1) unless (-d "$pwd/$langdir/punie");
+$exe = quote(catfile($pwd, $bindir, 'parrot-punie'));
+skip("Punie", 1) unless (-d "$pwd/$langdir/punie" || -e $exe);
 chdir("$pwd/$langdir/punie");
 $filename = 'test.p1';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "print \"Hello, World!\";\n";
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-punie');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot punie.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello, World!", "check punie");
@@ -477,15 +460,14 @@
 
 SKIP:
 {
-skip("Pynie", 1) unless (-d "$pwd/$langdir/pynie");
+$exe = quote(catfile($pwd, $bindir, 'parrot-pynie'));
+skip("Pynie", 1) unless (-d "$pwd/$langdir/pynie" || -e $exe);
 chdir("$pwd/$langdir/pynie");
 $filename = 'test.py';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "print('Hello, World!')\n";
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-pynie');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot pynie.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello, World!\n", "check pynie");
@@ -494,10 +476,9 @@
 
 SKIP:
 {
-skip("Rakudo", 1) unless (-d "$pwd/$langdir/rakudo");
+$exe = quote(catfile($pwd, $bindir, 'perl6'));
+skip("Rakudo", 1) unless (-d "$pwd/$langdir/rakudo" || -e $exe);
 chdir("$pwd/$langdir/rakudo");
-$exe = catfile($pwd, $bindir, 'perl6');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot perl6.pbc" unless (-e $exe);
 $out = `$exe -e "say 'hello world'"`;
 ok($out eq "hello world\n", "check rakudo");
@@ -505,7 +486,8 @@
 
 SKIP:
 {
-skip("Shakespeare", 1) unless (-d "$pwd/$langdir/shakespeare");
+$exe = quote(catfile($pwd, $bindir, 'parrot-shakespeare'));
+skip("Shakespeare", 1) unless (-d "$pwd/$langdir/shakespeare" || -e $exe);
 chdir("$pwd/$langdir/shakespeare");
 $filename = 'test.spl';
 open $FH, '>', $filename
@@ -603,8 +585,6 @@
 
 CODE
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-shakespeare');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot shakespeare.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello World!\n", "check shakespeare");
@@ -613,15 +593,14 @@
 
 SKIP:
 {
-skip("steme", 1) unless (-d "$pwd/$langdir/steme");
+$exe = quote(catfile($pwd, $bindir, 'parrot-steme'));
+skip("steme", 1) unless (-d "$pwd/$langdir/steme" || -e $exe);
 chdir("$pwd/$langdir/steme");
 $filename = 'test.scm';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "( say \"Hello, World!\" )\n";
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-steme');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot steme.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello, World!\n", "check steme");
@@ -630,15 +609,14 @@
 
 SKIP:
 {
-skip("Squaak", 1) unless (-d "$pwd/$langdir/squaak");
+$exe = quote(catfile($pwd, $bindir, 'parrot-squaak'));
+skip("Squaak", 1) unless (-d "$pwd/$langdir/squaak" || -e $exe);
 chdir("$pwd/$langdir/squaak");
 $filename = 'test.squaak';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "print(\"Hello, World!\")\n";
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-squaak');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot squaak.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello, World!\n", "check squaak");
@@ -647,7 +625,8 @@
 
 SKIP:
 {
-skip("unlambda", 1) unless (-d "$pwd/$langdir/unlambda");
+$exe = quote(catfile($pwd, $bindir, 'parrot-unl'));
+skip("unlambda", 1) unless (-d "$pwd/$langdir/unlambda" || -e $exe);
 chdir("$pwd/$langdir/unlambda");
 $filename = 'test.unl';
 open $FH, '>', $filename
@@ -657,8 +636,6 @@
 `r```````````.H.e.l.l.o. .w.o.r.l.di
 CODE
 close $FH;
-$exe = catfile($pwd, $bindir, 'parrot-unl');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot unl.pbc" unless (-e $exe);
 $out = `$exe $filename`;
 ok($out eq "Hello world\n", "check unlambda");
@@ -667,7 +644,8 @@
 
 SKIP:
 {
-skip("WMLScript", 1) unless (-d "$pwd/$langdir/wmlscript");
+$exe = quote(catfile($pwd, $bindir, 'parrot-wmlsi'));
+skip("WMLScript", 1) unless (-d "$pwd/$langdir/wmlscript" || -e $exe);
 skip("WMLScript, not wmlsc", 1) unless (`wmlsc -h` =~ /wmlsc/);
 chdir("$pwd/$langdir/wmlscript");
 
@@ -682,8 +660,6 @@
 CODE
 close $FH;
 `wmlsc $filename`;
-$exe = catfile($pwd, $bindir, 'parrot-wmlsi');
-$exe .= '.exe' if ($^O eq 'MSWin32');
 $exe = "$parrot wmlsi.pbc" unless (-e $exe);
 $out = `$exe ${filename}c main`;
 ok($out eq "Hello World!\n", "check wmlscript");


More information about the parrot-commits mailing list