I've just added a feature to Parrot::Test to allow you to add todo => 'reason' to the end of all test function calls. This will mark the tests as TODO in a way that Test::Builder understands.
All failing TODO tests are successes in the eyes of the test harness and do not appear in the short summary report. All succeeding TODO tests are unexpected successes and raise a happy note in the short summary report. Adding TODO tests is a good way to write tests for things you know don't work without making more failures than you want to record. If there are no objections in a couple of days, I'll apply the patch myself. -- c
Index: lib/Parrot/Test.pm =================================================================== --- lib/Parrot/Test.pm (revision 8214) +++ lib/Parrot/Test.pm (working copy) @@ -31,6 +31,13 @@ The parameter C<$unexpected> is the unexpected result. The parameter C<$description> should describe the test. +Any optional parameters can follow. For example, to mark a test as a TODO test (where you know the implementation does not yet work), pass: + + todo => 'reason to consider this TODO' + +at the end of the argument list. Valid reasons include C<bug>, +C<unimplemented>, and so on. + =over 4 =item C<pasm_output_is($code, $expected, $description)> or C<output_is($code, $expected, $description)> @@ -313,8 +320,8 @@ foreach my $func ( keys %parrot_test_map ) { no strict 'refs'; - *{$package.'::'.$func} = sub ($$;$) { - my( $code, $expected, $desc) = @_; + *{$package.'::'.$func} = sub ($$;$%) { + my( $code, $expected, $desc, %extra ) = @_; # Strange Win line endings $expected =~ s/\cM\cJ/\n/g; @@ -421,6 +428,12 @@ $expected =~ s/[\t ]+/ /gm; $expected =~ s/[\t ]+$//gm; } + + # set a TODO for Test::Builder to find + my $call_pkg = $builder->exported_to(); + local *{ $call_pkg . '::TODO' } + = defined $extra{todo} ? \$extra{todo} : ''; + my $pass = $builder->$meth( $real_output, $expected, $desc ); $builder->diag("'$cmd' failed with exit code $exit_code") if $exit_code and not $pass;