cvsuser 05/02/25 14:07:13
Modified: imcc/t harness
imcc/t/reg .cvsignore
imcc/t/syn .cvsignore pcc.t
lib/Parrot Test.pm
t harness
t/dynclass .cvsignore
t/pmc sub.t
Log:
'make testr' wasn't actually writing and then reading PBC.
Added some '*.pbc' to some .cvsignore file.
Marked one issue with '@no-spam as TODO in test file
A sub marked as @no-spam @no-spam is executed twice with 'parrot -o file.pbc -r -r'
Revision Changes Path
1.10 +3 -1 parrot/imcc/t/harness
Index: harness
===================================================================
RCS file: /cvs/public/parrot/imcc/t/harness,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- harness 23 Oct 2003 17:23:06 -0000 1.9
+++ harness 25 Feb 2005 22:07:05 -0000 1.10
@@no-spam -1,5 +1,5 @@no-spam
#! perl -w
-# $Id: harness,v 1.9 2003/10/23 17:23:06 robert Exp $
+# $Id: harness,v 1.10 2005/02/25 22:07:05 bernhard Exp $
#Blatantly stolen from parrot/t/harness by Mike Lambert
#Then blatantly stolen from perl6/t/harness by leo ;-)
@@no-spam -12,6 +12,8 @@no-spam
# Suck the switches into the TEST_PROG_ARGS evar:
#
+die "This file was thought to be obsolete by Bernhard Schmalhofer";
+
use Getopt::Std;
my %opts;
getopts('wgjPSbvdr?hO:', \%opts);
1.4 +1 -0 parrot/imcc/t/reg/.cvsignore
Index: .cvsignore
===================================================================
RCS file: /cvs/public/parrot/imcc/t/reg/.cvsignore,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- .cvsignore 24 Oct 2003 06:40:10 -0000 1.3
+++ .cvsignore 25 Feb 2005 22:07:06 -0000 1.4
@@no-spam -1 +1,2 @@no-spam
*.imc
+*.pbc
1.4 +1 -0 parrot/imcc/t/syn/.cvsignore
Index: .cvsignore
===================================================================
RCS file: /cvs/public/parrot/imcc/t/syn/.cvsignore,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- .cvsignore 24 Oct 2003 06:40:15 -0000 1.3
+++ .cvsignore 25 Feb 2005 22:07:07 -0000 1.4
@@no-spam -1 +1,2 @@no-spam
*.imc
+*.pbc
1.47 +8 -3 parrot/imcc/t/syn/pcc.t
Index: pcc.t
===================================================================
RCS file: /cvs/public/parrot/imcc/t/syn/pcc.t,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- pcc.t 14 Dec 2004 09:06:23 -0000 1.46
+++ pcc.t 25 Feb 2005 22:07:07 -0000 1.47
@@no-spam -1235,14 +1235,19 @@no-spam
ok
OUT
-output_is(<<'CODE', <<'OUT', "more pragmas, syntax only");
+{
+ # The result of the code depends on wether we run parrot with the
+ # "-o code.pbc -r -r" command line params
+ my $output = $ENV{TEST_PROG_ARGS} =~ m/-r / ?
+ qq{ok\nok\n} :
+ qq{ok\n};
+ output_is(<<'CODE', $output, "more pragmas, syntax only");
.sub _main prototyped, @no-spam @no-spam @no-spam
print "ok\n"
end
.end
CODE
-ok
-OUT
+}
output_is(<<'CODE', <<'OUT', "_func() syntax");
.sub _main
1.63 +5 -12 parrot/lib/Parrot/Test.pm
Index: Test.pm
===================================================================
RCS file: /cvs/public/parrot/lib/Parrot/Test.pm,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- Test.pm 22 Feb 2005 21:39:16 -0000 1.62
+++ Test.pm 25 Feb 2005 22:07:09 -0000 1.63
@@no-spam -1,5 +1,5 @@no-spam
# Copyright: 2004 The Perl Foundation. All Rights Reserved.
-# $Id: Test.pm,v 1.62 2005/02/22 21:39:16 bernhard Exp $
+# $Id: Test.pm,v 1.63 2005/02/25 22:07:09 bernhard Exp $
=head1 NAME
@@no-spam -101,14 +101,11 @@no-spam
package Parrot::Test;
use strict;
-use vars qw(@no-spam @no-spam $TEST_PROG_ARGS);
+use vars qw(@no-spam @no-spam
use Parrot::Config;
use File::Spec;
use Data::Dumper;
-# 5.005_03 Env.pm doesn't make its arguments immune from use strict 'vars';
-use Env qw($TEST_PROG_ARGS);
-
require Exporter;
require Test::Builder;
require Test::More;
@@no-spam -288,24 +285,20 @@no-spam
$as_f = per_test('.imc',$count);
}
- $TEST_PROG_ARGS = $ENV{TEST_PROG_ARGS} || '';
- my $args = $TEST_PROG_ARGS;
+ my $args = $ENV{TEST_PROG_ARGS} || '';
- my $run_pbc = 0;
- if ($args =~ s/--run-pbc//) {
+ if ($args =~ s/--run-pbc// || $args =~ s/-r //) {
# native tests with --run-pbc don't make sense
if ($func =~ /^pbc_output_/) {
- return $Builder->ok(1, $desc);
+ return $Builder->skip( "no native tests with -r" );
}
my $pbc_f = per_test('.pbc', $count);
- $run_pbc = 1;
$args = "$args -o $pbc_f -r -r";
}
# native tests are just run
if ($func =~ /^pbc_output_/) {
$as_f = per_test('.pbc',$count);
- $run_pbc = 0;
}
else {
$as_f = File::Spec->rel2abs($as_f);
1.24 +22 -9 parrot/t/harness
Index: harness
===================================================================
RCS file: /cvs/public/parrot/t/harness,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- harness 2 Feb 2005 12:23:31 -0000 1.23
+++ harness 25 Feb 2005 22:07:10 -0000 1.24
@@no-spam -1,6 +1,6 @@no-spam
#! perl -w
-# Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-# $Id: harness,v 1.23 2005/02/02 12:23:31 leo Exp $
+# Copyright: 2001-2005 The Perl Foundation. All Rights Reserved.
+# $Id: harness,v 1.24 2005/02/25 22:07:10 bernhard Exp $
=head1 NAME
@@no-spam -12,7 +12,7 @@no-spam
=head1 DESCRIPTION
-Command-line options are:
+The short command line options are:
=over 4
@@no-spam -54,7 +54,7 @@no-spam
=item C<-r>
-assemble to Parrot bytecode and then run the bytecode.
+compile to Parrot bytecode and then run the bytecode.
=item C<-O[012]>
@@no-spam -62,6 +62,20 @@no-spam
=back
+There are also long command line options:
+
+=over 4
+
+=item C<--running-make-test>
+
+Some test scripts run more quickly when this is set.
+
+=item C<--gc-debug>
+
+Invoke parrot with '--gc-debug'.
+
+=back
+
=cut
use strict;
@@no-spam -71,14 +85,12 @@no-spam
use Test::Harness qw(runtests);
# handle the long options
+
$ENV{RUNNING_MAKE_TEST} = grep { $_ eq '--running-make-test' } @no-spam
@no-spam = grep { $_ ne '--running-make-test' } @no-spam
-$ENV{PARROT_QUICKTEST} = grep { $_ eq 'quick' } @no-spam
-@no-spam = grep { $_ ne 'quick' } @no-spam
+
my $gc_debug = grep { $_ eq '--gc-debug' } @no-spam
@no-spam = grep { $_ ne '--gc-debug' } @no-spam
-my $run_pbc = grep { $_ eq '--run-pbc' } @no-spam
-@no-spam = grep { $_ ne '--run-pbc' } @no-spam
# Suck the short options into the TEST_PROG_ARGS evar:
my %opts;
@@no-spam -98,6 +110,8 @@no-spam
-d ... run debug
-r ... assemble to PBC run PBC
-O[012] optimize
+ --running-make-test
+ --gc-debug
EOF
exit;
}
@@no-spam -105,7 +119,6 @@no-spam
my $args = join(' ', map { "-$_" } keys %opts );
$args =~ s/-O/-O$opts{O}/ if ($opts{O});
$args .= ' --gc-debug' if $gc_debug;
-$args .= ' --run-pbc' if $run_pbc;
$ENV{TEST_PROG_ARGS} = $args;
# Pass in a list of tests to run on the command line, else run all the tests.
1.2 +1 -0 parrot/t/dynclass/.cvsignore
Index: .cvsignore
===================================================================
RCS file: /cvs/public/parrot/t/dynclass/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 10 Nov 2004 01:23:24 -0000 1.1
+++ .cvsignore 25 Feb 2005 22:07:11 -0000 1.2
@@no-spam -1 +1,2 @@no-spam
*.imc
+*.pbc
1.56 +20 -5 parrot/t/pmc/sub.t
Index: sub.t
===================================================================
RCS file: /cvs/public/parrot/t/pmc/sub.t,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- sub.t 11 Dec 2004 12:08:13 -0000 1.55
+++ sub.t 25 Feb 2005 22:07:13 -0000 1.56
@@no-spam -1,6 +1,6 @@no-spam
#! perl -w
# Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-# $Id: sub.t,v 1.55 2004/12/11 12:08:13 leo Exp $
+# $Id: sub.t,v 1.56 2005/02/25 22:07:13 bernhard Exp $
=head1 NAME
@@no-spam -1272,10 +1272,12 @@no-spam
ok
OUTPUT
-# the test is failing when run with --run-pbc (make testr)
-# actually the POSTCOMP is run and "initial" is printed, but
-# its not captured by the test system
-output_is(<<'CODE', <<'OUTPUT', '@no-spam
+{
+ # the test is failing when run with --run-pbc (make testr)
+ # actually the POSTCOMP is run and "initial" is printed, but
+ # its not captured by the test system
+
+ my $code = << 'CODE';
##PIR##
.sub optc @no-spam @no-spam
print "initial\n"
@@no-spam -1284,9 +1286,22 @@no-spam
print "main\n"
.end
CODE
+ my $output = << 'OUTPUT';
initial
main
OUTPUT
+ my $descr = '@no-spam @no-spam
+ if ( $ENV{TEST_PROG_ARGS} =~ m/-r / )
+ {
+ TODO:
+ {
+ local $TODO = "output from POSTCOMP is lost";
+ output_is( $code, $output, $descr);
+ };
+ } else {
+ output_is( $code, $output, $descr);
+ }
+}
pir_output_like(<<'CODE', <<'OUTPUT', '@no-spam
.sub main @no-spam