{
    "mode": "perldoc",
    "parameter": "TAP::Parser::Scheduler",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/TAP%3A%3AParser%3A%3AScheduler/json",
    "generated": "2026-06-12T11:56:19Z",
    "synopsis": "use TAP::Parser::Scheduler;",
    "sections": {
        "NAME": {
            "content": "TAP::Parser::Scheduler - Schedule tests during parallel testing\n",
            "subsections": []
        },
        "VERSION": {
            "content": "Version 3.43\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use TAP::Parser::Scheduler;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "",
            "subsections": []
        },
        "METHODS": {
            "content": "",
            "subsections": [
                {
                    "name": "Class Methods",
                    "content": "\"new\"\nmy $sched = TAP::Parser::Scheduler->new(tests => \\@tests);\nmy $sched = TAP::Parser::Scheduler->new(\ntests => [ ['t/testname.t','Test Description'], ... ],\nrules => \\%rules,\n);\n\nGiven 'tests' and optional 'rules' as input, returns a new \"TAP::Parser::Scheduler\" object. Each\nmember of @tests should be either a a test file name, or a two element arrayref, where the first\nelement is a test file name, and the second element is a test description. By default, we'll use\nthe test name as the description.\n\nThe optional \"rules\" attribute provides direction on which tests should be run in parallel and\nwhich should be run sequentially. If no rule data structure is provided, a default data\nstructure is used which makes every test eligible to be run in parallel:\n\n{ par => '' },\n\nThe rules data structure is documented more in the next section.\n"
                },
                {
                    "name": "Rules data structure",
                    "content": "The \"\"rules\"\" data structure is the the heart of the scheduler. It allows you to express simple\nrules like \"run all tests in sequence\" or \"run all tests in parallel except these five tests.\".\nHowever, the rules structure also supports glob-style pattern matching and recursive\ndefinitions, so you can also express arbitarily complicated patterns.\n\nThe rule must only have one top level key: either 'par' for \"parallel\" or 'seq' for \"sequence\".\n\nValues must be either strings with possible glob-style matching, or arrayrefs of strings or\nhashrefs which follow this pattern recursively.\n\nEvery element in an arrayref directly below a 'par' key is eligible to be run in parallel, while\nvavalues directly below a 'seq' key must be run in sequence.\n\nRules examples\nHere are some examples:\n\n# All tests be run in parallel (the default rule)\n{ par => '' },\n\n# Run all tests in sequence, except those starting with \"p\"\n{ par => 't/p*.t' },\n\n# Run all tests in parallel, except those starting with \"p\"\n{\nseq => [\n{ seq => 't/p*.t' },\n{ par => ''     },\n],\n}\n\n# Run some  startup tests in sequence, then some parallel tests then some\n# teardown tests in sequence.\n{\nseq => [\n{ seq => 't/startup/*.t' },\n{ par => ['t/a/*.t','t/b/*.t','t/c/*.t'], }\n{ seq => 't/shutdown/*.t' },\n],\n},\n\nRules resolution\n*   By default, all tests are eligible to be run in parallel. Specifying any of your own rules\nremoves this one.\n\n*   \"First match wins\". The first rule that matches a test will be the one that applies.\n\n*   Any test which does not match a rule will be run in sequence at the end of the run.\n\n*   The existence of a rule does not imply selecting a test. You must still specify the tests to\nrun.\n\n*   Specifying a rule to allow tests to run in parallel does not make the run in parallel. You\nstill need specify the number of parallel \"jobs\" in your Harness object.\n\nGlob-style pattern matching for rules\nWe implement our own glob-style pattern matching. Here are the patterns it supports:\n\nis any number of characters, including /, within a pathname\n* is zero or more characters within a filename/directory name\n? is exactly one character within a filename/directory name\n{foo,bar,baz} is any of foo, bar or baz.\n\\ is an escape character\n"
                },
                {
                    "name": "Instance Methods",
                    "content": "\"getall\"\nGet a list of all remaining tests.\n\n\"getjob\"\nReturn the next available job as TAP::Parser::Scheduler::Job object or \"undef\" if none are\navailable. Returns a TAP::Parser::Scheduler::Spinner if the scheduler still has pending jobs but\nnone are available to run right now.\n\n\"asstring\"\nReturn a human readable representation of the scheduling tree. For example:\n\nmy @tests = (qw{\nt/startup/foo.t\nt/shutdown/foo.t\n\nt/a/foo.t t/b/foo.t t/c/foo.t t/d/foo.t\n});\nmy $sched = TAP::Parser::Scheduler->new(\ntests => \\@tests,\nrules => {\nseq => [\n{ seq => 't/startup/*.t' },\n{ par => ['t/a/*.t','t/b/*.t','t/c/*.t'] },\n{ seq => 't/shutdown/*.t' },\n],\n},\n);\n\nProduces:\n\npar:\nseq:\npar:\nseq:\npar:\nseq:\n't/startup/foo.t'\npar:\nseq:\n't/a/foo.t'\nseq:\n't/b/foo.t'\nseq:\n't/c/foo.t'\npar:\nseq:\n't/shutdown/foo.t'\n't/d/foo.t'\n"
                }
            ]
        }
    },
    "summary": "TAP::Parser::Scheduler - Schedule tests during parallel testing",
    "flags": [],
    "examples": [],
    "see_also": []
}