Permalink
Browse files

Add test for loading perl6.pbc bytecode

  • Loading branch information...
1 parent a546773 commit b45dd1f7b4a896c727500b64a2e17645b30f073b @leto committed Jun 9, 2010
Showing with 43 additions and 2 deletions.
  1. +1 −1 build/Makefile.in
  2. +29 −0 t/02-embed/01-load.pir
  3. +13 −1 t/harness
View
@@ -395,7 +395,7 @@ test : coretest
fulltest: coretest spectest
coretest: Test.pir $(PERL6_EXE)
- $(PERL) t/harness t/00-parrot t/01-sanity
+ PARROT=$(PARROT) $(PERL) t/harness t/00-parrot t/01-sanity t/02-embed/01-load.pir
# Run the spectests that we know work.
spectest_regression: spectest
View
@@ -0,0 +1,29 @@
+=head1 NAME
+
+t/02-embed/01-load.pir - Tests loading of bytecode
+
+=head1 SYNOPSIS
+
+ % perl t/harness t/02-embed/01-load.pir
+
+=head1 DESCRIPTION
+
+Tests the loading of perl6.pbc
+
+=cut
+
+.sub 'main' :main
+ .include 'test_more.pir'
+
+ plan(1)
+
+ test_load()
+.end
+
+.sub test_load
+ lives_ok(<<'CODE',"can load_bytecode perl6.pbc")
+.sub main
+ load_bytecode "perl6.pbc"
+.end
+CODE
+.end
View
@@ -68,7 +68,19 @@ if ($archive) {
if (eval "require $tap_harness_class;") {
my %harness_options = (
- exec => ['./perl6'],
+ # We assume that .t files are Perl 6
+ # and run .pir files with Parrot that we were configured with
+ exec => sub {
+ my ( $harness, $test_file ) = @_;
+ my $parrot = $ENV{PARROT};
+ unless ($parrot) {
+ my $bindir = `parrot_config bindir`;
+ chomp $bindir;
+ $parrot = File::Spec->catfile($bindir, 'parrot');
+ }
+ return ['./perl6', $test_file ] if $test_file =~ /[.]t$/;
+ return [ $parrot, $test_file ] if $test_file =~ /[.]pir$/;
+ },
verbosity => 0+$Test::Harness::verbose,
jobs => $ENV{TEST_JOBS} || $jobs || 1,
ignore_exit => 1,

0 comments on commit b45dd1f

Please sign in to comment.