I don't know if this is the way to go on principal, and I definitely feel
that passing flags around in environment variables and unadorned on command
lines is a messy hack, but I wanted to run the test suite with the JIT.

So I did this:

--- Makefile~   Tue Jan  1 20:10:58 2002
+++ Makefile    Tue Jan  1 22:19:10 2002
@@ -331,10 +331,22 @@
 #
 ###############################################################################
 
-test: $(TEST_PROG) assemble.pl .test_dummy
+test_common: $(TEST_PROG) assemble.pl
+
+test: test_common .test_dummy
 
 .test_dummy:
        $(PERL) t/harness
+
+test_jit: test_common  .test_jit_dummy
+
+.test_jit_dummy:
+       $(PERL) t/harness -j
+
+test_prederef: test_common  .test_prederef_dummy
+
+.test_prederef_dummy:
+       $(PERL) t/harness -P
 
 mopstest: $(TEST_PROG) examples/assembly/mops.pbc
        $(TEST_PROG) examples/assembly/mops.pbc
--- t/harness~  Sat Dec 15 14:21:46 2001
+++ t/harness   Tue Jan  1 20:45:27 2002
@@ -3,5 +3,9 @@
 use strict;
 use Test::Harness qw(runtests);
 
+if (@ARGV) {
+  $ENV{PARROT_TEST_OPTS} = shift;
+}
+
 my @tests = map { glob( "t/$_/*.t" ) } ( qw(op) );
 runtests( @tests );
--- Parrot/Test.pm~     Sat Dec 15 14:19:56 2001
+++ Parrot/Test.pm      Tue Jan  1 20:47:06 2002
@@ -12,6 +12,9 @@
 @EXPORT = ( qw(output_is output_like output_isnt), @Test::More::EXPORT );
 @ISA = qw(Exporter Test::More);
 
+my $test_opts = exists $ENV{PARROT_TEST_OPTS} ? $ENV{PARROT_TEST_OPTS} : '';
+
+
 sub import {
   my( $class, $plan, @args ) = @_;
 
@@ -60,7 +63,7 @@
     close ASSEMBLY;
 
     _run_command( "$PConfig{perl} assemble.pl $as_f --output $by_f" );
-    _run_command( "./$PConfig{test_prog} $by_f", 'STDOUT' => $out_f, 'STDERR' => 
$out_f);
+    _run_command( "./$PConfig{test_prog} $test_opts $by_f", 'STDOUT' => $out_f, 
+'STDERR' => $out_f);
 
     my $prog_output;
     open OUTPUT, "< $out_f";



after make shared I can do this like normal:

nick@thinking-cap [parrot]$ LD_LIBRARY_PATH=blib/lib make test
/usr/bin/perl t/harness
t/op/basic..........ok
t/op/bitwise........ok
t/op/debuginfo......ok
t/op/hacks..........ok
t/op/integer........ok
t/op/interp.........ok
t/op/macro..........ok
t/op/number.........ok
t/op/pmc............ok, 1/47 subtest skipped
t/op/pmc_perlstring.ok
t/op/stacks.........ok, 1/19 subtest skipped
t/op/string.........ok
t/op/time...........ok
t/op/trans..........ok
All tests successful, 2 subtests skipped.
Files=14,  Tests=249, 710 wallclock secs (577.37 cusr + 49.16 csys = 626.53 CPU)

and I can test the prederef like this:

nick@thinking-cap [parrot]$ LD_LIBRARY_PATH=blib/lib make test_prederef
/usr/bin/perl t/harness -P
t/op/basic..........#     Failed test (Parrot/Test.pm at line 79)
#          got: ''
#     expected: 'start
lab 1
done
'
# Looks like you failed 1 tests of 8.
dubious
        Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 8
        Failed 1/8 tests, 87.50% okay
t/op/bitwise........ok
t/op/debuginfo......ok
t/op/hacks..........ok
t/op/integer........#     Failed test (Parrot/Test.pm at line 79)
#          got: ''
#     expected: 'the word
done 1
done 2
done 3
'
#     Failed test (Parrot/Test.pm at line 79)
#          got: ''
#     expected: 'start
done 1
done 2
done 3
'
# Looks like you failed 2 tests of 30.
dubious
        Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 12, 15
        Failed 2/30 tests, 93.33% okay
t/op/interp.........ok
t/op/macro..........ok
t/op/number.........ok
t/op/pmc............ok, 1/47 subtest skipped
t/op/pmc_perlstring.#     Failed test (Parrot/Test.pm at line 79)
#          got: ''
#     expected: 'x
12
xxxxxxxxxxxx
'
# Looks like you failed 1 tests of 4.
dubious
        Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 4
        Failed 1/4 tests, 75.00% okay
t/op/stacks.........ok, 1/19 subtest skipped
t/op/string.........#     Failed test (Parrot/Test.pm at line 79)
#          got: ''
#     expected: 'ok 1
ok 2
ok 3
ok 4
'
# Looks like you failed 1 tests of 63.
dubious
        Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 25
        Failed 1/63 tests, 98.41% okay
t/op/time...........ok
t/op/trans..........ok
Failed Test  Status Wstat Total Fail  Failed  List of failed
-------------------------------------------------------------------------------
t/op/basic.t      1   256     8    1  12.50%  8
t/op/integer.t    2   512    30    2   6.67%  12, 15
t/op/pmc_perlst   1   256     4    1  25.00%  4
t/op/string.t     1   256    63    1   1.59%  25
2 subtests skipped.
Failed 4/14 test scripts, 71.43% okay. 5/249 subtests failed, 97.99% okay.
*** Error code 2

and the JIT like this (and I've no idea why '1' doesn't match '1')

nick@thinking-cap [parrot]$ LD_LIBRARY_PATH=blib/lib make test_jit     
/usr/bin/perl t/harness -j
t/op/basic..........#     Failed test (Parrot/Test.pm at line 79)
#          got: '1'
#     expected: '1'
#     Failed test (Parrot/Test.pm at line 79)
#          got: '42'
#     expected: '42'
#     Failed test (Parrot/Test.pm at line 79)
#          got: ''
#     expected: '42
1234
'
#     Failed test (Parrot/Test.pm at line 79)
#          got: 'start
done
'
#     expected: 'start
lab 1
done
'
# Looks like you failed 4 tests of 8.
dubious
        Test returned status 4 (wstat 1024, 0x400)
DIED. FAILED tests 2, 6-8
        Failed 4/8 tests, 50.00% okay
t/op/bitwise........#     Failed test (Parrot/Test.pm at line 79)
#          got: ''
#     expected: '6
6
5
12
'
^C


So, what's going wrong, and why all the segvs?
I figured it was better to start by wondering about the prederef code.
But I might just go to bed instead. Or fix compiler warnings. or perl5

The prederef does work, as does the JIT:

nick@thinking-cap [parrot]$ LD_LIBRARY_PATH=blib/lib ./test_parrot 
examples/assembly/mops.pbc 
Iterations:    100000000
Estimated ops: 200000000
Elapsed time:  91.229787
M op/s:        2.192266
nick@thinking-cap [parrot]$ LD_LIBRARY_PATH=blib/lib ./test_parrot -P 
examples/assembly/mops.pbc 
Iterations:    100000000
Estimated ops: 200000000
Elapsed time:  60.178785
M op/s:        3.323430
nick@thinking-cap [parrot]$ LD_LIBRARY_PATH=blib/lib ./test_parrot -j 
examples/assembly/mops.pbc 
Iterations:    100000000
Estimated ops: 200000000
Elapsed time:  4.572718
M op/s:        43.737663

For information, if this is relevant:
FreeBSD thinking-cap.moo 4.0-RELEASE FreeBSD 4.0-RELEASE #0: Mon Mar 20 22:50:22 GMT 
2000     [EMAIL PROTECTED]:/usr/src/sys/compile/GENERIC  i386

it's an AMD K5 133 with 16M RAM and a couple of very slow, small hard disks.

Nicholas Clark

Reply via email to