[svn:parrot] r36731 - in trunk: . tools/install
fperrad at svn.parrot.org
fperrad at svn.parrot.org
Sat Feb 14 15:47:56 UTC 2009
Author: fperrad
Date: Sat Feb 14 15:47:56 2009
New Revision: 36731
URL: https://trac.parrot.org/parrot/changeset/36731
Log:
[install] add a smoke test for external languages
Added:
trunk/tools/install/smoke-languages.pl
- copied, changed from r36670, trunk/tools/install/smoke.pl
Modified:
trunk/MANIFEST
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST Sat Feb 14 15:46:51 2009 (r36730)
+++ trunk/MANIFEST Sat Feb 14 15:47:56 2009 (r36731)
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Sat Feb 14 09:07:48 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Sat Feb 14 15:45:08 2009 UT
#
# See tools/dev/install_files.pl for documentation on the
# format of this file.
@@ -3174,6 +3174,7 @@
tools/docs/func_boilerplate.pl []
tools/docs/ops_summary.pl []
tools/docs/write_docs.pl []
+tools/install/smoke-languages.pl []
tools/install/smoke.pl []
tools/util/crow.pir []
tools/util/dump_pbc.pl []
Copied and modified: trunk/tools/install/smoke-languages.pl (from r36670, trunk/tools/install/smoke.pl)
==============================================================================
--- trunk/tools/install/smoke.pl Fri Feb 13 11:19:46 2009 (r36670, copy source)
+++ trunk/tools/install/smoke-languages.pl Sat Feb 14 15:47:56 2009 (r36731)
@@ -9,29 +9,29 @@
use Getopt::Long;
use File::Spec::Functions;
-use Test::More tests => 23;
+use Test::More tests => 10;
=head1 NAME
-tools/install/smoke.pl - checks parrot in install directory
+tools/install/smoke-languages.pl - checks some languages in install directory
=head1 SYNOPSIS
-parrot in bin
+parrot in install tree
% cd /usr/local/parrot-$version
- % perl tools/install/smoke.pl
+ % perl tools/install/smoke-languages.pl
-parrot in .
+parrot in build tree
- % perl tools/install/smoke.pl --bindir=. --libdir=./runtime
+ % perl tools/install/smoke-languages.pl --bindir=.
test installation in DESTDIR:
% cd /usr/src/parrot
% mkdir .inst
% make install DESTDIR=.inst
- % perl tools/install/smoke.pl DESTDIR=.inst
+ % perl tools/install/smoke-languages.pl DESTDIR=.inst
=head1 DESCRIPTION
@@ -46,23 +46,17 @@
Override default value : 'bin'
-=item --libdir=/usr/lib
-
-Override default value : 'lib'
-
=back
=cut
-my ($bindir, $libdir, $DESTDIR);
+my ($bindir, $DESTDIR);
my $opts = GetOptions(
'bindir=s' => \$bindir,
- 'libdir=s' => \$libdir,
'DESTDIR=s' => \$DESTDIR,
);
$bindir = 'bin' unless $bindir;
-$libdir = 'lib' unless $libdir;
chdir $DESTDIR if ($DESTDIR);
@@ -71,181 +65,219 @@
my $out;
my $FH;
my $parrot = catfile($bindir, 'parrot');
-my $pirc = catfile($bindir, 'pirc');
-
-#
-# parrot executable
-#
-$exe = catfile($bindir, 'pbc_merge');
-$out = `$exe`;
-ok($out =~ /^pbc_merge/, "check pbc_merge");
-
-$exe = catfile($bindir, 'pbc_dump');
-$out = `$exe`;
-ok($out =~ /^pbc_dump/, "check pbc_dump");
-
-ok(system("$parrot -V") == 0, "display parrot version");
+$out = `$parrot -V`;
+$out =~ m/version (\S+) built/;
+my $version = $1;
+
+my $langdir = ($bindir eq 'bin')
+ ? "lib/parrot/$version/languages"
+ : 'languages';
+
+SKIP:
+{
+skip("skip Rakudo", 1) unless (-d "$langdir/rakudo");
+$exe = catfile($bindir, 'perl6');
+$out = `$exe -v`;
+ok($out =~ /Rakudo/, "check rakudo");
+}
#
-# some compiler tools
+# some languages
#
-$filename = 'test.pg';
+SKIP:
+{
+skip("skip gil", 1) unless (-d "$langdir/gil");
+$filename = 'test.gil';
open $FH, '>', $filename
or die "Can't open $filename ($!).\n";
-print $FH "token TOP { \\s* }\n";
+print $FH q{say('Hello, world!');};
close $FH;
-$out = `$parrot $libdir/parrot/library/PGE/Perl6Grammar.pir $filename`;
-ok($out =~ /^\n## <::TOP>/, "check PGE");
+$out = `$parrot $langdir/gil/gil.pbc $filename`;
+ok($out eq "Hello, world!\n", "check gil");
unlink($filename);
+}
-$filename = 'test.pir';
+SKIP:
+{
+skip("skip HQ9Plus", 1) unless (-d "$langdir/hq9plus");
+$filename = 'test.HQ9Plus';
open $FH, '>', $filename
or die "Can't open $filename ($!).\n";
-print $FH <<'PIR';
-.sub main
- say "hello world!"
-.end
-PIR
+print $FH "H";
close $FH;
-$out = `$pirc -n $filename`;
-ok($out eq "ok\n", "check pirc");
+$out = `$parrot $langdir/hq9plus/hq9plus.pbc $filename`;
+ok($out eq "Hello, world!\n", "check HQ9Plus");
unlink($filename);
+}
-# compilers/tge is typically not installed
-$filename = 'test.tg';
+SKIP:
+{
+skip("skip Lua", 1) unless (-d "$langdir/lua");
+$out = `$parrot $langdir/lua/lua.pbc -e "print(nil)"`;
+ok($out eq "nil\n", "check lua");
+}
+
+SKIP:
+{
+skip("skip m4", 1) unless (-d "$langdir/m4");
+$out = `$parrot $langdir/m4/m4.pbc`;
+ok($out =~ /^Usage/, "check m4");
+}
+
+SKIP:
+{
+skip("skip Markdown", 1) unless (-d "$langdir/markdown");
+$filename = 'test.text';
open $FH, '>', $filename
or die "Can't open $filename ($!).\n";
-print $FH "transform past (ROOT) { }\n";
+print $FH "Hello, World!\n\n";
close $FH;
-$out = `$parrot compilers/tge/tgc.pir $filename`;
-ok($out =~ /^\n\.sub '_ROOT_past'/, "check TGE");
+$out = `$parrot $langdir/markdown/markdown.pbc $filename`;
+ok($out eq "<p>Hello, World!</p>\n\n", "check markdown");
unlink($filename);
+}
-# compilers/nqp is typically not installed
-$filename = 'test.nqp';
+SKIP:
+{
+skip("skip primitivearc", 1) unless (-d "$langdir/primitivearc");
+$filename = 'test.arc';
open $FH, '>', $filename
or die "Can't open $filename ($!).\n";
-print $FH "say('hello world!');\n";
+print $FH q{"Hello, world!\n"};
close $FH;
-$out = `$parrot compilers/nqp/nqp.pbc $filename`;
-ok($out eq "hello world!\n", "check nqp");
+$out = `$parrot $langdir/primitivearc/arc.pbc $filename`;
+ok($out eq "Hello, world!\n\n", "check primitivearc");
unlink($filename);
+}
-#
-# some languages
-#
+SKIP:
+{
+skip("skip Rakudo", 1) unless (-d "$langdir/rakudo");
+$out = `$parrot $langdir/rakudo/perl6.pbc -e "say 'hello world'"`;
+ok($out eq "hello world\n", "check rakudo");
+}
-$filename = 'test.bc';
+SKIP:
+{
+skip("skip Shakespeare", 1) unless (-d "$langdir/shakespeare");
+$filename = 'test.spl';
open $FH, '>', $filename
or die "Can't open $filename ($!).\n";
-print $FH "1 + 2\n";
-close $FH;
-$out = `$parrot languages/abc/abc.pbc $filename`;
-ok($out eq "3\n", "check abc");
-unlink($filename);
+print $FH <<'CODE';
+The Infamous Hello World Program.
-$filename = 'test.apl';
-open $FH, '>', $filename
- or die "Can't open $filename ($!).\n";
-print $FH "\"Hello world!\"";
-close $FH;
-$out = `$parrot languages/APL/APL.pbc $filename`;
-ok($out eq "Hello world!\n", "check APL");
-unlink($filename);
+Romeo, a young man with a remarkable patience.
+Juliet, a likewise young woman of remarkable grace.
+Ophelia, a remarkable woman much in dispute with Hamlet.
+Hamlet, the flatterer of Andersen Insulting A/S.
-$out = `$parrot languages/bf/bf.pbc`;
-ok($out =~ /^usage/, "check bf");
-$out = `$parrot languages/bf/bfc.pbc`;
-ok($out =~ /^usage/, "check bfc");
-$out = `$parrot languages/bf/bfco.pbc`;
-ok($out =~ /^usage/, "check bfco");
-$out = `$parrot languages/cardinal/cardinal.pbc -e "print 'hello world';"`;
-ok($out eq "hello world", "check cardinal");
+ Act I: Hamlet's insults and flattery.
-$out = `$parrot languages/dotnet/net2pbc.pbc`;
-ok($out =~ /^Usage/, "check dotnet");
+ Scene I: The insulting of Romeo.
-$filename = 'test.js';
-open $FH, '>', $filename
- or die "Can't open $filename ($!).\n";
-print $FH "print(\"Hello World from JS\\n\");";
-close $FH;
-$out = `$parrot languages/ecmascript/js.pbc $filename`;
-ok($out eq "Hello World from JS\n\n", "check ecmascript");
-unlink($filename);
+[Enter Hamlet and Romeo]
-TODO: {
-local $TODO = "lisp is currently broken";
-$filename = 'test.l';
-open $FH, '>', $filename
- or die "Can't open $filename ($!).\n";
-print $FH "( print \"Hello, World!\" )\n";
-close $FH;
-$out = `$parrot languages/lisp/lisp.pbc $filename`;
-ok($out eq "Hello, World!\n", "check lisp");
-unlink($filename);
-}
+Hamlet:
+ You lying stupid fatherless big smelly half-witted coward!
+ You are as stupid as the difference between a handsome rich brave
+ hero and thyself! Speak your mind!
-$filename = 'test.lolcode';
-open $FH, '>', $filename
- or die "Can't open $filename ($!).\n";
-print $FH <<'LOLCODE';
-HAI 1.2
- VISIBLE "HAI WORLD!"
-KTHXBYE
-LOLCODE
-close $FH;
-$out = `$parrot languages/lolcode/lolcode.pbc $filename`;
-ok($out eq "HAI WORLD!\n", "check lolcode");
-unlink($filename);
+ You are as brave as the sum of your fat little stuffed misused dusty
+ old rotten codpiece and a beautiful fair warm peaceful sunny summer's
+ day. You are as healthy as the difference between the sum of the
+ sweetest reddest rose and my father and yourself! Speak your mind!
-$filename = 'test.l';
-open $FH, '>', $filename
- or die "Can't open $filename ($!).\n";
-print $FH "( write \"Hello, World!\\n\" )\n";
-close $FH;
-$out = `$parrot languages/pheme/pheme.pbc $filename`;
-ok($out eq "Hello, World!\n", "check pheme");
-unlink($filename);
+ You are as cowardly as the sum of yourself and the difference
+ between a big mighty proud kingdom and a horse. Speak your mind.
-$filename = 'test.php';
-open $FH, '>', $filename
- or die "Can't open $filename ($!).\n";
-print $FH "<?php echo \"Hello, World!\\n\"; ?>";
-close $FH;
-$out = `$parrot languages/pipp/pipp.pbc $filename`;
-ok($out eq "Hello, World!\n", "check pipp");
-unlink($filename);
+ Speak your mind!
-$filename = 'test.p1';
-open $FH, '>', $filename
- or die "Can't open $filename ($!).\n";
-print $FH "print \"Hello, World!\\n\";\n";
-close $FH;
-$out = `$parrot languages/punie/punie.pbc $filename`;
-ok($out eq "Hello, World!\n", "check punie");
-unlink($filename);
+[Exit Romeo]
-$filename = 'test.py';
-open $FH, '>', $filename
- or die "Can't open $filename ($!).\n";
-print $FH "print 'Hello, World!'\n";
+ Scene II: The praising of Juliet.
+
+[Enter Juliet]
+
+Hamlet:
+ Thou art as sweet as the sum of the sum of Romeo and his horse and his
+ black cat! Speak thy mind!
+
+[Exit Juliet]
+
+ Scene III: The praising of Ophelia.
+
+[Enter Ophelia]
+
+Hamlet:
+ Thou art as lovely as the product of a large rural town and my amazing
+ bottomless embroidered purse. Speak thy mind!
+
+ Thou art as loving as the product of the bluest clearest sweetest sky
+ and the sum of a squirrel and a white horse. Thou art as beautiful as
+ the difference between Juliet and thyself. Speak thy mind!
+
+[Exeunt Ophelia and Hamlet]
+
+
+ Act II: Behind Hamlet's back.
+
+ Scene I: Romeo and Juliet's conversation.
+
+[Enter Romeo and Juliet]
+
+Romeo:
+ Speak your mind. You are as worried as the sum of yourself and the
+ difference between my small smooth hamster and my nose. Speak your
+ mind!
+
+Juliet:
+ Speak YOUR mind! You are as bad as Hamlet! You are as small as the
+ difference between the square of the difference between my little pony
+ and your big hairy hound and the cube of your sorry little
+ codpiece. Speak your mind!
+
+[Exit Romeo]
+
+ Scene II: Juliet and Ophelia's conversation.
+
+[Enter Ophelia]
+
+Juliet:
+ Thou art as good as the quotient between Romeo and the sum of a small
+ furry animal and a leech. Speak your mind!
+
+Ophelia:
+ Thou art as disgusting as the quotient between Romeo and twice the
+ difference between a mistletoe and an oozing infected blister! Speak
+ your mind!
+
+[Exeunt]
+
+CODE
close $FH;
-$out = `$parrot languages/pynie/pynie.pbc $filename`;
-ok($out eq "Hello, World!\n", "check pynie");
+$out = `$parrot $langdir/shakespeare/shakespeare.pbc $filename`;
+ok($out eq "Hello World!\n", "check shakespeare");
unlink($filename);
+}
-$filename = 'test.squaak';
+SKIP:
+{
+skip("skip unlambda", 1) unless (-d "$langdir/unlambda");
+$filename = 'test.unl';
open $FH, '>', $filename
or die "Can't open $filename ($!).\n";
-print $FH "print(\"Hello, World!\")\n";
+print $FH <<'CODE';
+# hello world
+`r```````````.H.e.l.l.o. .w.o.r.l.di
+CODE
close $FH;
-$out = `$parrot languages/squaak/squaak.pbc $filename`;
-ok($out eq "Hello, World!\n", "check squaak");
+$out = `$parrot $langdir/unlambda/unl.pbc $filename`;
+ok($out eq "Hello world\n", "check unlambda");
unlink($filename);
+}
# Local Variables:
# mode: cperl
@@ -253,4 +285,3 @@
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4:
-
More information about the parrot-commits
mailing list