{
    "mode": "perldoc",
    "parameter": "TAP::Parser::Aggregator",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/TAP%3A%3AParser%3A%3AAggregator/json",
    "generated": "2026-06-10T17:18:35Z",
    "synopsis": "use TAP::Parser::Aggregator;\nmy $aggregate = TAP::Parser::Aggregator->new;\n$aggregate->add( 't/00-load.t', $loadparser );\n$aggregate->add( 't/10-lex.t',  $lexparser  );\nmy $summary = <<'ENDSUMMARY';\nPassed:  %s\nFailed:  %s\nUnexpectedly succeeded: %s\nENDSUMMARY\nprintf $summary,\nscalar $aggregate->passed,\nscalar $aggregate->failed,\nscalar $aggregate->todopassed;",
    "sections": {
        "NAME": {
            "content": "TAP::Parser::Aggregator - Aggregate TAP::Parser results\n",
            "subsections": []
        },
        "VERSION": {
            "content": "Version 3.43\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use TAP::Parser::Aggregator;\n\nmy $aggregate = TAP::Parser::Aggregator->new;\n$aggregate->add( 't/00-load.t', $loadparser );\n$aggregate->add( 't/10-lex.t',  $lexparser  );\n\nmy $summary = <<'ENDSUMMARY';\nPassed:  %s\nFailed:  %s\nUnexpectedly succeeded: %s\nENDSUMMARY\nprintf $summary,\nscalar $aggregate->passed,\nscalar $aggregate->failed,\nscalar $aggregate->todopassed;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "\"TAP::Parser::Aggregator\" collects parser objects and allows reporting/querying their aggregate\nresults.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "",
            "subsections": [
                {
                    "name": "Class Methods",
                    "content": "\"new\"\nmy $aggregate = TAP::Parser::Aggregator->new;\n\nReturns a new \"TAP::Parser::Aggregator\" object.\n"
                },
                {
                    "name": "Instance Methods",
                    "content": "\"add\"\n$aggregate->add( $description => $parser );\n\nThe $description is usually a test file name (but only by convention.) It is used as a unique\nidentifier (see e.g. \"parsers\".) Reusing a description is a fatal error.\n\nThe $parser is a TAP::Parser object.\n\n\"parsers\"\nmy $count   = $aggregate->parsers;\nmy @parsers = $aggregate->parsers;\nmy @parsers = $aggregate->parsers(@descriptions);\n\nIn scalar context without arguments, this method returns the number of parsers aggregated. In\nlist context without arguments, returns the parsers in the order they were added.\n\nIf @descriptions is given, these correspond to the keys used in each call to the add() method.\nReturns an array of the requested parsers (in the requested order) in list context or an array\nreference in scalar context.\n\nRequesting an unknown identifier is a fatal error.\n\n\"descriptions\"\nGet an array of descriptions in the order in which they were added to the aggregator.\n\n\"start\"\nCall \"start\" immediately before adding any results to the aggregator. Among other times it\nrecords the start time for the test run.\n\n\"stop\"\nCall \"stop\" immediately after adding all test results to the aggregator.\n\n\"elapsed\"\nElapsed returns a Benchmark object that represents the running time of the aggregated tests. In\norder for \"elapsed\" to be valid you must call \"start\" before running the tests and \"stop\"\nimmediately afterwards.\n\n\"elapsedtimestr\"\nReturns a formatted string representing the runtime returned by \"elapsed()\". This lets the\ncaller not worry about Benchmark.\n\n\"allpassed\"\nReturn true if all the tests passed and no parse errors were detected.\n\n\"getstatus\"\nGet a single word describing the status of the aggregated tests. Depending on the outcome of the\ntests returns 'PASS', 'FAIL' or 'NOTESTS'. This token is understood by CPAN::Reporter.\n"
                },
                {
                    "name": "Summary methods",
                    "content": "Each of the following methods will return the total number of corresponding tests if called in\nscalar context. If called in list context, returns the descriptions of the parsers which contain\nthe corresponding tests (see \"add\" for an explanation of description.\n\n*   failed\n\n*   parseerrors\n\n*   passed\n\n*   planned\n\n*   skipped\n\n*   todo\n\n*   todopassed\n\n*   wait\n\n*   exit\n\nFor example, to find out how many tests unexpectedly succeeded (TODO tests which passed when\nthey shouldn't):\n\nmy $count        = $aggregate->todopassed;\nmy @descriptions = $aggregate->todopassed;\n\nNote that \"wait\" and \"exit\" are the totals of the wait and exit statuses of each of the tests.\nThese values are totalled only to provide a true value if any of them are non-zero.\n\n\"total\"\nmy $testsrun = $aggregate->total;\n\nReturns the total number of tests run.\n\n\"hasproblems\"\nif ( $parser->hasproblems ) {\n...\n}\n\nIdentical to \"haserrors\", but also returns true if any TODO tests unexpectedly succeeded. This\nis more akin to \"warnings\".\n\n\"haserrors\"\nif ( $parser->haserrors ) {\n...\n}\n\nReturns true if *any* of the parsers failed. This includes:\n\n*   Failed tests\n\n*   Parse errors\n\n*   Bad exit or wait status\n\n\"todofailed\"\n# deprecated in favor of 'todopassed'.  This method was horribly misnamed.\n\nThis was a badly misnamed method. It indicates which TODO tests unexpectedly succeeded. Will now\nissue a warning and call \"todopassed\".\n\nSee Also\nTAP::Parser\n\nTAP::Harness\n"
                }
            ]
        }
    },
    "summary": "TAP::Parser::Aggregator - Aggregate TAP::Parser results",
    "flags": [],
    "examples": [],
    "see_also": []
}