GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Test2::Harness::Collector::TapParser(3) User Contributed Perl Documentation Test2::Harness::Collector::TapParser(3)

Test2::Harness::Collector::TapParser - Produce EventFacets from a line of TAP.

This module is responsible for reading and processing any TAP output from tests. Lines of TAP output are processed into Test2::Event facet data. Note that "Test2 -> TAP -> Test2" is lossy at the "Test2 -> TAP" step.

    use Test2::Harness::Collector::TapParser qw/parse_tap_line/;

    my $facet_data = parse_tap_line("1..1");
    is(
        $facet_data,
        {
            trace => {nested => 0},
            hubs  => [{nested => 0}],
            plan  => {
                details => '',
                count   => 1,
                skip    => 0,
            },
        },
        "Parsed the plan"
    );

    $facet_data = parse_tap_line("# foo");
    is(
        $facet_data,
    {
              trace => { nested => 0 },
              hubs => [ { nested => 0 } ],
              info => [
                          {
                            tag => 'NOTE',
                            details => 'foo',
                            debug => 0,
                          },
                        ],
            },

        "Parsed the note"
    );

    $facet_data = parse_tap_line("ok 1");
    is(
        $facet_data,
        {
            trace  => {nested => 0},
            hubs   => [{nested => 0}],
            assert => {
                no_debug => 1,
                pass     => 1,
                number   => '1',
                details  => '',
            },
        },
        "Parsed the assertion"
    );

$facet_data = parse_tap_line($line)
Parse a line of TAP. It is assumed to be STDOUT thus all comments are turned into notes. Using this export will NOT add the usual "from_tap" facet. It is better to use one of the other 2 exports.
$facet_data = parse_stdout_tap($line)
Parse a line of TAP from stdout.
$facet_data = parse_stderr_tap($line)
Parse a line of TAP from stderr. This will ONLY parse comment lines (ones that start with a "#", which may be indented). All comments will be treated as diag's, all other lines will be ignored.

The source code repository for Test2-Harness can be found at http://github.com/Test-More/Test2-Harness/.

Chad Granum <exodist@cpan.org>

Chad Granum <exodist@cpan.org>

Copyright 2020 Chad Granum <exodist7@gmail.com>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://dev.perl.org/licenses/

2022-03-23 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.