# New Ticket Created by Leopold Toetsch
# Please include the string: [perl #17470]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=17470 >
This patch adds a test case for restarting the interpreter. To get this
running, patch includes 2 bugfixes too.
- core.ops print to file was broken
- Test.pm didn't honor TEST_PROG_ARGS
$ perl6 t/harness -P t/op/interp.t
$ perl6 t/harness -j t/op/interp.t
$ make test TEST_PROG_ARGS=-j
now work as expected.
Please apply,
leo
PS: -P and -j on platforms that support it, could be added to testruns
on tinderboxen.
-- attachment 1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/38209/31054/e52f0b/interp-restart-test.patch
--- parrot/core.ops Mon Sep 9 11:42:19 2002
+++ parrot-leo/core.ops Sat Sep 21 13:57:19 2002
@@ -314,7 +314,7 @@
default: file = OPCODE_T2PTR(FILE *, $1);
}
if (s && string_length(s)) {
- fwrite(s->strstart, s->strlen, 1, stdout);
+ fwrite(s->strstart, s->strlen, 1, file);
}
goto NEXT();
}
@@ -333,7 +333,7 @@
default: file = OPCODE_T2PTR(FILE *, $1);
}
if (s) {
- fwrite(s->strstart, s->strlen, 1, stdout);
+ fwrite(s->strstart, s->strlen, 1, file);
}
goto NEXT();
}
--- parrot/t/op/interp.t Tue Jan 29 03:32:17 2002
+++ parrot-leo/t/op/interp.t Sat Sep 21 14:37:52 2002
@@ -1,6 +1,6 @@
#! perl -w
-use Parrot::Test tests => 1;
+use Parrot::Test tests => 2;
output_is(<<'CODE', <<'OUTPUT', "runinterp");
newinterp P0, 0
@@ -16,6 +16,24 @@
calling
In 2
ending
+OUTPUT
+
+output_like(<<'CODE', <<'OUTPUT', "restart trace");
+ print 2, "ok 1\n"
+ set I0, 1
+ trace I0
+ print 2, "ok 2\n"
+ dec I0
+ trace I0
+ print 2, "ok 3\n"
+ end
+CODE
+/^ok\s1\n
+(?:PC=8.*)?\n
+ok\s2\n
+(?:PC=11.*)?\n
+(?:PC=13.*)?\n
+ok\s3\n$/x
OUTPUT
1;
--- parrot/lib/Parrot/Test.pm Mon Sep 16 09:22:50 2002
+++ parrot-leo/lib/Parrot/Test.pm Sat Sep 21 14:37:11 2002
@@ -114,7 +114,7 @@
my $by_f = per_test('.pbc',$count);
my $out_f = per_test('.out',$count);
- $TEST_PROG_ARGS = "" unless defined $TEST_PROG_ARGS;
+ $TEST_PROG_ARGS = $ENV{TEST_PROG_ARGS} || '';
_run_command( "${directory}$PConfig{test_prog} ${TEST_PROG_ARGS} $by_f",
'STDOUT' => $out_f, 'STDERR' => $out_f);
my $prog_output;