New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test for loading perl6.pbc as bytecode #1824
Comments
From jaleto@gmail.comHowdy, I have attached a small patch that adds a test for loading perl6.pbc It required making t/harness a bit smarter, so that it runs .pir files Duke -- |
From jaleto@gmail.com0001-Add-test-for-loading-perl6.pbc-bytecode.patchFrom b45dd1f7b4a896c727500b64a2e17645b30f073b Mon Sep 17 00:00:00 2001
From: Duke Leto <jonathan@leto.net>
Date: Wed, 9 Jun 2010 13:44:41 -0700
Subject: [PATCH] Add test for loading perl6.pbc bytecode
---
build/Makefile.in | 2 +-
t/02-embed/01-load.pir | 29 +++++++++++++++++++++++++++++
t/harness | 14 +++++++++++++-
3 files changed, 43 insertions(+), 2 deletions(-)
create mode 100644 t/02-embed/01-load.pir
diff --git a/build/Makefile.in b/build/Makefile.in
index 48eea9b..4424ede 100644
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -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
diff --git a/t/02-embed/01-load.pir b/t/02-embed/01-load.pir
new file mode 100644
index 0000000..f851d98
--- /dev/null
+++ b/t/02-embed/01-load.pir
@@ -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
diff --git a/t/harness b/t/harness
index 73cd653..dcd2579 100644
--- a/t/harness
+++ b/t/harness
@@ -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,
--
1.7.0.4
|
From jonathan@leto.netmoritz++ asked me on IRC when TAP::Harness got the feature of exec being |
From @pmichaudThere are still a number of not-too-old Linux distros that use It seems to me that an easier approach might be to use Perl 6's qx() or Pm |
The RT System itself - Status changed from 'new' to 'open' |
From jonathan@leto.netI've made a new patch that does not require TAP::Harness 3.x, and uses a |
From jonathan@leto.net0002-Add-test-for-loading-perl6.pbc-bytecode.patchFrom 039c18b01b2c12b95de560c5a26bdc7ac9dd7a32 Mon Sep 17 00:00:00 2001
From: Duke Leto <jonathan@leto.net>
Date: Wed, 9 Jun 2010 13:44:41 -0700
Subject: [PATCH] Add test for loading perl6.pbc bytecode
---
build/Makefile.in | 2 +-
t/02-embed/01-load.pir | 29 +++++++++++++++++++++++++++++
t/02-embed/01-load.t | 3 +++
3 files changed, 33 insertions(+), 1 deletions(-)
create mode 100644 t/02-embed/01-load.pir
create mode 100644 t/02-embed/01-load.t
diff --git a/build/Makefile.in b/build/Makefile.in
index 48eea9b..62606c0 100644
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -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
# Run the spectests that we know work.
spectest_regression: spectest
diff --git a/t/02-embed/01-load.pir b/t/02-embed/01-load.pir
new file mode 100644
index 0000000..948ed25
--- /dev/null
+++ b/t/02-embed/01-load.pir
@@ -0,0 +1,29 @@
+=head1 NAME
+
+t/02-embed/01-load.pir - Tests loading of bytecode
+
+=head1 SYNOPSIS
+
+ % parrot t/02-embed/01-load.pir
+
+=head1 DESCRIPTION
+
+Tests the loading of perl6.pbc . This file is used by t/02-embed/01-load.t
+
+=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
diff --git a/t/02-embed/01-load.t b/t/02-embed/01-load.t
new file mode 100644
index 0000000..709a5f3
--- /dev/null
+++ b/t/02-embed/01-load.t
@@ -0,0 +1,3 @@
+use v6;
+my $parrot = %*ENV{'PARROT'};
+run("$parrot t/02-embed/01-load.pir");
--
1.7.0.4
|
From [Unknown Contact. See original ticket]I've made a new patch that does not require TAP::Harness 3.x, and uses a |
From @moritzThanks, I've applied your last patch as |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#75650 (status was 'resolved')
Searchable as RT75650$
The text was updated successfully, but these errors were encountered: