James E Keenan > TAP-Harness-Multiple-0.07 > TAP::Harness::ReportByDescription

Download:
TAP-Harness-Multiple-0.07.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.06   Source  

NAME ^

TAP::Harness::ReportByDescription - Report TAP output by test file description rather than test file name

VERSION ^

0.01

SYNOPSIS ^

    use TAP::Harness::ReportByDescription;
    my $harness = TAP::Harness::ReportByDescription->new();
    $harness->aggregate_tests($aggregator, @tests);

DESCRIPTION ^

This package subclasses TAP::Harness for the purpose of enabling a user to report the TAP output for a test file by a user-provided description rather than by the name of the test file itself.

Why would you want to do this? Three reasons come to mind.

In short, we need (a) a way to run multiple harnesses as if they were one, (b) run the same tests through multiple harnesses and be able to quickly identify which harness we were running it through, and (c) store multiple versions of a file's TAP output in a test harness archive.

Need (a) can actually be fulfilled with existing TAP::Parser::Aggregator functionality. Let's build on that to meet needs (b) and (c). To do that we need one package to subclass TAP::Harness and one to subclass TAP::Harness::Archive. TAP::Harness::ReportByDescription and TAP::Harness::Archive::MultiplesHarnesses are these packages.

METHODS ^

new()

Inherited from TAP::Harness.

aggregate_tests()

Replicated, along with methods called internally from this method, from TAP::Harness. The only change occurs in an internal method _get_parser_args(), which now assigns the individual test's filename to one variable and a user-provided description to a second variable.

    my $test_prog = $job->filename;
    my $spool_prog = $job->description;

It is the latter variable which will appear on the console and in a test archive. Since this occurs within an internal method, the user need make no change in how aggregate_tests() is called.

EXAMPLE ^

See TAP::Harness::Archive::MultipleHarnesses::runtests().

AUTHOR ^

99% of the code in this module comes from TAP::Harness, written by Andy Armstrong and generations of Perl QA hackers. Documentation and the one small code tweak needed were written by James E Keenan.

LICENSE ^

This is free software and is released under the same terms as Perl itself.

syntax highlighting: