2 # Copyright (C) 2001-2008, The Perl Foundation.
11 # need runtests from T::H, but avoid running all our parrot invocations with -w
13 undef $Test::Harness::Switches;
15 use Parrot::Harness::DefaultTests qw(
19 use Parrot::Harness::Options qw(
24 use Parrot::Harness::Smoke qw(
25 generate_html_smoke_report
26 send_archive_to_smolder
30 (my $longopts, @ARGV) = handle_long_options(@ARGV);
32 $ENV{RUNNING_MAKE_TEST} = $longopts->{running_make_test};
34 # Suck the short options into the TEST_PROG_ARGS
35 # environmental variable.
37 getopts('wgjPCSefbvdr?hO:D:', \%opts);
39 if ($opts{'?'} || $opts{h} || $longopts->{help}) {
44 # add -D40; merge it with any existing -D argument
45 $opts{D} = sprintf( '%x', hex(40) | (exists $opts{D} ? hex($opts{D}) : 0));
47 my $args = get_test_prog_args(
48 \%opts, $longopts->{gc_debug}, $longopts->{run_exec}
50 $ENV{TEST_PROG_ARGS} = $args;
52 # now build the list of tests to run, either from the command
53 # line or from @default tests
54 my @default_tests = get_default_tests(
55 $longopts->{core_tests_only},
56 $longopts->{runcore_tests_only}
60 if ($longopts->{code}) {
61 @tests = @developing_tests;
63 @tests = map { glob($_) } (@ARGV ? @ARGV : @default_tests);
66 if ($longopts->{html}) {
67 generate_html_smoke_report(
76 if ($longopts->{archive}) {
77 eval { require TAP::Harness::Archive };
79 die "\n" . ('-' x 55) . "\nCould not load TAP::Harness::Archive."
80 . "\nPlease install it if you want to create TAP archives.\n"
81 . ('-' x 55) . "\n\n$@\n";
83 $harness = TAP::Harness::Archive->new(
85 verbosity => $ENV{HARNESS_VERBOSE},
86 archive => 'parrot_test_run.tar.gz',
91 eval { require TAP::Harness };
93 Test::Harness::runtests(@tests);
97 $harness = TAP::Harness->new({
98 verbosity => $ENV{HARNESS_VERBOSE}, merge => 0
103 $harness->runtests(@tests);
105 if ($longopts->{send_to_smolder}) {
106 send_archive_to_smolder();
112 t/harness - Parrot Test Harness
116 % perl t/harness [options] [testfiles]
120 The short command line options are:
130 Run the C<CGoto> core.
134 Run with JIT enabled.
146 Run bounds checking enabled.
150 Run with debugging enabled.
158 compile to Parrot bytecode and then run the bytecode.
162 Run optimized to the specified level.
166 Pass the specified debug bits to the parrot interpreter. Note that
167 C<-D40> (fill I, N registers with garbage) is always enabled.
168 See 'parrot --help-debug' for available flags.
172 There are also long command line options:
176 =item C<--running-make-test>
178 Some test scripts run more quickly when this is set.
182 Invoke parrot with '--gc-debug'.
186 Emit a C<smoke.html> file instead of displaying results.
188 =item C<--code-tests>
190 Run only the file metadata and basic coding standards tests.
196 Mike Lambert stole F<t/harness> for F<languages/perl6/t/harness>.
198 Leo Toetsch stole F<languages/perl6/t/harness> for F<imcc/t/harness>.
200 Bernhard Schmalhofer merged F<imcc/t/harness> back into F<t/harness>.
207 # cperl-indent-level: 4
210 # vim: expandtab shiftwidth=4: