* t/pmc/complex.t:
[parrot.git] / t / harness
blob13bbd1f88d13f7bbc9083905ab354f5685a13e63
1 #!perl
2 # Copyright (C) 2001-2008, The Perl Foundation.
3 # $Id$
5 use strict;
6 use warnings;
7 use lib qw( lib );
9 use Getopt::Std;
10 use Test::Harness ();
11 use Parrot::Harness::DefaultTests;
12 use Parrot::Harness::Options qw(
13     handle_long_options
14     get_test_prog_args
15     Usage
17 use Parrot::Harness::Smoke qw(
18     generate_html_smoke_report
21 local @ARGV = @ARGV;
22 (my $longopts, @ARGV) = handle_long_options(@ARGV);
24 $ENV{RUNNING_MAKE_TEST} = $longopts->{running_make_test};
26 # Suck the short options into the TEST_PROG_ARGS 
27 # environmental variable.
28 my %opts;
29 getopts('wgjPCSefbvdr?hO:D:', \%opts);
31 if ($opts{'?'} || $opts{h} || $longopts->{help}) {
32     Usage();
33     exit;
36 # add -D40;  merge it with any existing -D argument
37 $opts{D} = sprintf( '%x', hex(40) | (exists $opts{D} ? hex($opts{D}) : 0));
39 my $args = get_test_prog_args(
40     \%opts, $longopts->{gc_debug}, $longopts->{run_exec}
42 $ENV{TEST_PROG_ARGS} = $args;
44 # now build the list of tests to run, either from the command
45 # line or from @default tests
46 my @default_tests = get_default_tests(
47     $longopts->{core_tests_only},
48     $longopts->{runcore_tests_only}
51 my @tests = map { glob( $_ ) } (@ARGV ? @ARGV : @default_tests);
53 if ( ! $longopts->{html} ) {
54     Test::Harness::runtests(@tests);
56 else {
57     generate_html_smoke_report ( {
58         tests       => \@tests,
59         args        => $args,
60         file        => 'smoke.html',
61     } );
64 =head1 NAME
66 t/harness - Parrot Test Harness
68 =head1 SYNOPSIS
70     % perl t/harness [options] [testfiles]
72 =head1 DESCRIPTION
74 The short command line options are:
76 =over 4
78 =item C<-w>
80 Turn warnings on.
82 =item C<-g>
84 Run the C<CGoto> core.
86 =item C<-j>
88 Run with JIT enabled.
90 =item C<-C>
92 Run the C<CGP> core.
94 =item C<-S>
96 Run Switched.
98 =item C<-b>
100 Run bounds checking enabled.
102 =item C<-d>
104 Run with debugging enabled.
106 =item C<-f>
108 Run fast core.
110 =item C<-r>
112 compile to Parrot bytecode and then run the bytecode.
114 =item C<-O[012]>
116 Run optimized to the specified level.
118 =item C<-D[number]>
120 Pass the specified debug bits to the parrot interpreter.  Note that 
121 C<-D40> (fill I, N registers with garbage) is always enabled.  
122 See 'parrot --help-debug' for available flags.
124 =back
126 There are also long command line options:
128 =over 4
130 =item C<--running-make-test>
132 Some test scripts run more quickly when this is set.
134 =item C<--gc-debug>
136 Invoke parrot with '--gc-debug'.
138 =item C<--html>
140 Emit a C<smoke.html> file instead of displaying results.
142 =back
144 =head1 HISTORY
146 Mike Lambert stole F<t/harness> for F<languages/perl6/t/harness>.
148 Leo Toetsch stole F<languages/perl6/t/harness> for F<imcc/t/harness>.
150 Bernhard Schmalhofer merged F<imcc/t/harness> back into F<t/harness>.
152 =cut
155 # Local Variables:
156 #   mode: cperl
157 #   cperl-indent-level: 4
158 #   fill-column: 100
159 # End:
160 # vim: expandtab shiftwidth=4: