Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
teach fudgeandrun about --backend
  • Loading branch information
moritz committed Mar 27, 2014
1 parent 68e0948 commit 3699aaf
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions t/fudgeandrun
Expand Up @@ -2,9 +2,26 @@
use strict;
use warnings;

my $version = `./perl6 --version`;
use Getopt::Long;

my $impl = ($version =~ /jvm/i) ? "rakudo.jvm" : (($version =~ /moar/i) ? "rakudo.moar" : "rakudo.parrot");
GetOptions(
'backend=s' => \my $backend,
);

if ($backend) {
if ($backend =~ /^(parrot|jvm|moar)/i) {
$backend = lc $1;
}
else {
die "Unsupported backed '$backend'. Known backends: parrot, jvm, moar\n";
}
}
else {
my $version = `./perl6 --version`;
$backend = ($version =~ /jvm/i) ? "jvm" : (($version =~ /moar/i) ? "moar" : "parrot");
}

my $impl = "rakudo.$backend";

my @OPTS = ('--keep-exit-code', $impl);

Expand All @@ -23,4 +40,5 @@ my $nt = `t/spec/fudge @OPTS @ARGV`;
# ... or any other modules
my $pwd = `pwd`; chomp $pwd;
$ENV{PERL6LIB}="$pwd/lib:.";
system("./perl6", split ' ', $nt);
my $first = substr($backend, 0, 1);
system("./perl6-$first", split ' ', $nt);

0 comments on commit 3699aaf

Please sign in to comment.