Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First pass at the TB1 TAP formatter.
* Make the ending commentary dynamic in TAP::Base. * Make the directive label dynamic. The exit code commentary is still in Test::Builder, not in the formatter. I don't think that's critical, I doubt most tests were relying on that. For #215
- Loading branch information
Showing
2 changed files
with
86 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package TB2::Formatter::TAP::TB1; | ||
|
||
use TB2::Mouse; | ||
extends 'TB2::Formatter::TAP::v12'; | ||
|
||
=head1 NAME | ||
TB2::Formatter::TAP::TB1 - TAP formatter for compatibily with 0.98 | ||
=head1 DESCRIPTION | ||
This is a TAP formatter specifically designed to emulate the quirks of | ||
Test::Builder 0.98, the last stable release of Test::Builder before | ||
the TB2 architecture. This is intended to provide Test module authors | ||
with a smooth transition between 0.98 and 1.5. | ||
=cut | ||
|
||
# It was "# skip" but "# TODO" | ||
has '+directive_display' => | ||
default => sub { | ||
return { | ||
skip => 'skip', | ||
todo => 'TODO' | ||
} | ||
}; | ||
|
||
# Messages output as part of the ending commentary | ||
has '+diag_tests_but_no_plan' => | ||
default => "Tests were run but no plan was declared and done_testing() was not seen."; | ||
|
||
has '+diag_wrong_number_of_tests' => | ||
default => "Looks like you planned %d %s but ran %d."; | ||
|
||
has '+diag_tests_failed' => | ||
default => "Looks like you failed %d %s of %d run."; | ||
|
||
has '+diag_no_tests' => | ||
default => "No tests run!"; | ||
|
||
1; |