Permalink
Browse files

Change search path for Parrot: auto-find it in sibling Rakudo subdir

  • Loading branch information...
1 parent dc4fd26 commit fb6400e5cd626bacd4d65b9d00bcf158982105ea @chrisdolan committed Feb 23, 2009
Showing with 11 additions and 8 deletions.
  1. +9 −5 Makefile
  2. +2 −3 t/harness
View
@@ -1,5 +1,7 @@
PERL = perl
-PARROTDIR = ../..
+
+# Look for parrot in sibling Rakudo subdir, or own subdir, or up two (indicating we're in parrot/languages/perk)
+PARROTDIR = $(shell $(PERL) -le'print -e "../rakudo/parrot/parrot" ? "../rakudo/parrot" : -e "parrot/parrot" ? "parrot" : "../.."')
PARROT = $(PARROTDIR)/parrot
MERGEPBC = $(PARROTDIR)/pbc_merge
PCTDIR = $(PARROTDIR)/runtime/parrot/library
@@ -28,14 +30,16 @@ perk.pir: $(PIR) perk.pl $(PERL6PBC)
$(PERL6PBC): $(PERL6DIR)/perl6.pbc Makefile
$(CP) $< $@
+TEST_HARNESS = $(ENV) PARROTEXE=$(PARROT) $(PERL) t/harness
+
test: build
- $(ENV) $(PERL) t/harness
+ $(TEST_HARNESS)
test-parse: build
- $(ENV) $(PERL) t/harness --target=parse
+ $(TEST_HARNESS) --target=parse
test-past: build
- $(ENV) $(PERL) t/harness --target=past
+ $(TEST_HARNESS) --target=past
test-pir: build
- $(ENV) $(PERL) t/harness --target=pir
+ $(TEST_HARNESS) --target=pir
clean:
$(RM) $(PIR) $(PBC) perk.pbc perk.pir perl6.pbc
View
@@ -7,10 +7,11 @@ use strict;
use warnings;
use 5.008;
-use lib qw( . lib ../lib ../../lib ../../lib );
use File::Find qw(find);
use File::Spec;
+my $parrot = $ENV{PARROTEXE} || File::Spec->catfile('..', '..', 'parrot');
+
my @tests;
find({wanted => sub {
return unless m/\.java\z/;
@@ -25,11 +26,9 @@ find({wanted => sub {
}
}, no_chdir => 1}, 't');
-my $parrot = File::Spec->catfile('..', '..', 'parrot');
for my $test (sort @tests) {
print "==== $test ====\n";
my @cmd = ($parrot, 'perk.pbc', @ARGV, $test);
- #print " cmd: env PERL6LIB=$ENV{PERL6LIB} @cmd\n";
print " cmd: @cmd\n";
system(@cmd);
}

0 comments on commit fb6400e

Please sign in to comment.