{
    "mode": "man",
    "parameter": "prove",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/prove/1/json",
    "generated": "2026-06-02T23:33:15Z",
    "sections": {
        "NAME": {
            "content": "prove - Run tests through a TAP harness.\n",
            "subsections": []
        },
        "USAGE": {
            "content": "prove [options] [files or directories]\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "Boolean options:\n\n-v,  --verbose         Print all test lines.\n-l,  --lib             Add 'lib' to the path for your tests (-Ilib).\n-b,  --blib            Add 'blib/lib' and 'blib/arch' to the path for\nyour tests\n-s,  --shuffle         Run the tests in random order.\n-c,  --color           Colored test output (default).\n--nocolor         Do not color test output.\n--count           Show the X/Y test count when not verbose\n(default)\n--nocount         Disable the X/Y test count.\n-D   --dry             Dry run. Show test that would have run.\n-f,  --failures        Show failed tests.\n-o,  --comments        Show comments.\n--ignore-exit     Ignore exit status from test scripts.\n-m,  --merge           Merge test scripts' STDERR with their STDOUT.\n-r,  --recurse         Recursively descend into directories.\n--reverse         Run the tests in reverse order.\n-q,  --quiet           Suppress some test output while running tests.\n-Q,  --QUIET           Only print summary results.\n-p,  --parse           Show full list of TAP parse errors, if any.\n--directives      Only show results with TODO or SKIP directives.\n--timer           Print elapsed time after each test.\n--trap            Trap Ctrl-C and print summary on interrupt.\n--normalize       Normalize TAP output in verbose output\n-T                     Enable tainting checks.\n-t                     Enable tainting warnings.\n-W                     Enable fatal warnings.\n-w                     Enable warnings.\n-h,  --help            Display this help\n-?,                    Display this help\n-V,  --version         Display the version\n-H,  --man             Longer manpage for prove\n--norc            Don't process default .proverc\n\nOptions that take arguments:\n\n-I                     Library paths to include.\n-P                     Load plugin (searches App::Prove::Plugin::*.)\n-M                     Load a module.\n-e,  --exec            Interpreter to run the tests ('' for compiled\ntests.)\n--ext             Set the extension for tests (default '.t')\n--harness         Define test harness to use.  See TAP::Harness.\n--formatter       Result formatter to use. See FORMATTERS.\n--source          Load and/or configure a SourceHandler. See\nSOURCE HANDLERS.\n-a,  --archive out.tgz Store the resulting TAP in an archive file.\n-j,  --jobs N          Run N test jobs in parallel (try 9.)\n--state=opts      Control prove's persistent state.\n--statefile=file  Use `file` instead of `.prove` for state\n--rc=rcfile       Process options from rcfile\n--rules           Rules for parallel vs sequential processing.\n",
            "subsections": []
        },
        "NOTES": {
            "content": "",
            "subsections": [
                {
                    "name": ".proverc",
                    "content": "If ~/.proverc or ./.proverc exist they will be read and any options they contain processed\nbefore the command line options. Options in .proverc are specified in the same way as command\nline options:\n\n# .proverc\n--state=hot,fast,save\n-j9\n\nAdditional option files may be specified with the \"--rc\" option.  Default option file\nprocessing is disabled by the \"--norc\" option.\n\nUnder Windows and VMS the option file is named proverc rather than .proverc and is sought\nonly in the current directory.\n"
                },
                {
                    "name": "Reading from \"STDIN\"",
                    "content": "If you have a list of tests (or URLs, or anything else you want to test) in a file, you can\nadd them to your tests by using a '-':\n\nprove - < mylistofthingstotest.txt\n\nSee the \"README\" in the \"examples\" directory of this distribution.\n"
                },
                {
                    "name": "Default Test Directory",
                    "content": "If no files or directories are supplied, \"prove\" looks for all files matching the pattern\n\"t/*.t\".\n"
                },
                {
                    "name": "Colored Test Output",
                    "content": "Colored test output using TAP::Formatter::Color is the default, but if output is not to a\nterminal, color is disabled. You can override this by adding the \"--color\" switch.\n\nColor support requires Term::ANSIColor and, on windows platforms, also Win32::Console::ANSI.\nIf the necessary module(s) are not installed colored output will not be available.\n"
                },
                {
                    "name": "Exit Code",
                    "content": "If the tests fail \"prove\" will exit with non-zero status.\n"
                },
                {
                    "name": "Arguments to Tests",
                    "content": "It is possible to supply arguments to tests. To do so separate them from prove's own\narguments with the arisdottle, '::'. For example\n\nprove -v t/mytest.t :: --url http://example.com\n\nwould run t/mytest.t with the options '--url http://example.com'.  When running multiple\ntests they will each receive the same arguments.\n"
                },
                {
                    "name": "\"--exec\"",
                    "content": "Normally you can just pass a list of Perl tests and the harness will know how to execute\nthem.  However, if your tests are not written in Perl or if you want all tests invoked\nexactly the same way, use the \"-e\", or \"--exec\" switch:\n\nprove --exec '/usr/bin/ruby -w' t/\nprove --exec '/usr/bin/perl -Tw -mstrict -Ilib' t/\nprove --exec '/path/to/my/customer/exec'\n"
                },
                {
                    "name": "\"--merge\"",
                    "content": "If you need to make sure your diagnostics are displayed in the correct order relative to test\nresults you can use the \"--merge\" option to merge the test scripts' STDERR into their STDOUT.\n\nThis guarantees that STDOUT (where the test results appear) and STDERR (where the diagnostics\nappear) will stay in sync. The harness will display any diagnostics your tests emit on\nSTDERR.\n\nCaveat: this is a bit of a kludge. In particular note that if anything that appears on STDERR\nlooks like a test result the test harness will get confused. Use this option only if you\nunderstand the consequences and can live with the risk.\n"
                },
                {
                    "name": "\"--trap\"",
                    "content": "The \"--trap\" option will attempt to trap SIGINT (Ctrl-C) during a test run and display the\ntest summary even if the run is interrupted\n"
                },
                {
                    "name": "\"--state\"",
                    "content": "You can ask \"prove\" to remember the state of previous test runs and select and/or order the\ntests to be run based on that saved state.\n\nThe \"--state\" switch requires an argument which must be a comma separated list of one or more\nof the following options.\n\n\"last\"\nRun the same tests as the last time the state was saved. This makes it possible, for\nexample, to recreate the ordering of a shuffled test.\n\n# Run all tests in random order\n$ prove -b --state=save --shuffle\n\n# Run them again in the same order\n$ prove -b --state=last\n\n\"failed\"\nRun only the tests that failed on the last run.\n\n# Run all tests\n$ prove -b --state=save\n\n# Run failures\n$ prove -b --state=failed\n\nIf you also specify the \"save\" option newly passing tests will be excluded from\nsubsequent runs.\n\n# Repeat until no more failures\n$ prove -b --state=failed,save\n\n\"passed\"\nRun only the passed tests from last time. Useful to make sure that no new problems have\nbeen introduced.\n\n\"all\"\nRun all tests in normal order. Multple options may be specified, so to run all tests with\nthe failures from last time first:\n\n$ prove -b --state=failed,all,save\n\n\"hot\"\nRun the tests that most recently failed first. The last failure time of each test is\nstored. The \"hot\" option causes tests to be run in most-recent- failure order.\n\n$ prove -b --state=hot,save\n\nTests that have never failed will not be selected. To run all tests with the most\nrecently failed first use\n\n$ prove -b --state=hot,all,save\n\nThis combination of options may also be specified thus\n\n$ prove -b --state=adrian\n\n\"todo\"\nRun any tests with todos.\n\n\"slow\"\nRun the tests in slowest to fastest order. This is useful in conjunction with the \"-j\"\nparallel testing switch to ensure that your slowest tests start running first.\n\n$ prove -b --state=slow -j9\n\n\"fast\"\nRun test tests in fastest to slowest order.\n\n\"new\"\nRun the tests in newest to oldest order based on the modification times of the test\nscripts.\n\n\"old\"\nRun the tests in oldest to newest order.\n\n\"fresh\"\nRun those test scripts that have been modified since the last test run.\n\n\"save\"\nSave the state on exit. The state is stored in a file called .prove (prove on Windows\nand VMS) in the current directory.\n\nThe \"--state\" switch may be used more than once.\n\n$ prove -b --state=hot --state=all,save\n"
                },
                {
                    "name": "--rules",
                    "content": "The \"--rules\" option is used to control which tests are run sequentially and which are run in\nparallel, if the \"--jobs\" option is specified. The option may be specified multiple times,\nand the order matters.\n\nThe most practical use is likely to specify that some tests are not \"parallel-ready\".  Since\nmentioning a file with --rules doesn't cause it to be selected to run as a test, you can \"set\nand forget\" some rules preferences in your .proverc file. Then you'll be able to take maximum\nadvantage of the performance benefits of parallel testing, while some exceptions are still\nrun in parallel.\n\n--rules examples\n\n# All tests are allowed to run in parallel, except those starting with \"p\"\n--rules='seq=t/p*.t' --rules='par='\n\n# All tests must run in sequence except those starting with \"p\", which should be run parallel\n--rules='par=t/p*.t'\n\n--rules resolution\n\n•   By default, all tests are eligible to be run in parallel. Specifying any of your own\nrules removes 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\nto run.\n\n•   Specifying a rule to allow tests to run in parallel does not make them run in parallel.\nYou still need specify the number of parallel \"jobs\" in your Harness object.\n\n--rules Glob-style pattern matching\n\nWe implement our own glob-style pattern matching for --rules. Here are the supported\npatterns:\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\nMore advanced specifications for parallel vs sequence run rules\n\nIf you need more advanced management of what runs in parallel vs in sequence, see the\nassociated 'rules' documentation in TAP::Harness and TAP::Parser::Scheduler.  If what's\npossible directly through \"prove\" is not sufficient, you can write your own harness to access\nthese features directly.\n",
                    "long": "--rules"
                },
                {
                    "name": "@INC",
                    "content": "prove introduces a separation between \"options passed to the perl which runs prove\" and\n\"options passed to the perl which runs tests\"; this distinction is by design. Thus the perl\nwhich is running a test starts with the default @INC. Additional library directories can be\nadded via the \"PERL5LIB\" environment variable, via -Ifoo in \"PERL5OPT\" or via the \"-Ilib\"\noption to prove.\n"
                },
                {
                    "name": "Taint Mode",
                    "content": "Normally when a Perl program is run in taint mode the contents of the \"PERL5LIB\" environment\nvariable do not appear in @INC.\n\nBecause \"PERL5LIB\" is often used during testing to add build directories to @INC prove passes\nthe names of any directories found in \"PERL5LIB\" as -I switches. The net effect of this is\nthat \"PERL5LIB\" is honoured even when prove is run in taint mode.\n"
                }
            ]
        },
        "FORMATTERS": {
            "content": "You can load a custom TAP::Parser::Formatter:\n\nprove --formatter MyFormatter\n",
            "subsections": []
        },
        "SOURCE HANDLERS": {
            "content": "You can load custom TAP::Parser::SourceHandlers, to change the way the parser interprets\nparticular sources of TAP.\n\nprove --source MyHandler --source YetAnother t\n\nIf you want to provide config to the source you can use:\n\nprove --source MyCustom \\\n--source Perl --perl-option 'foo=bar baz' --perl-option avg=0.278 \\\n--source File --file-option extensions=.txt --file-option extensions=.tmp t\n--source pgTAP --pgtap-option pset=format=html --pgtap-option pset=border=2\n\nEach \"--$source-option\" option must specify a key/value pair separated by an \"=\". If an\noption can take multiple values, just specify it multiple times, as with the \"extensions=\"\nexamples above. If the option should be a hash reference, specify the value as a second pair\nseparated by a \"=\", as in the \"pset=\" examples above (escape \"=\" with a backslash).\n\nAll \"--sources\" are combined into a hash, and passed to \"new\" in TAP::Harness's \"sources\"\nparameter.\n\nSee TAP::Parser::IteratorFactory for more details on how configuration is passed to\nSourceHandlers.\n",
            "subsections": []
        },
        "PLUGINS": {
            "content": "Plugins can be loaded using the \"-Pplugin\" syntax, eg:\n\nprove -PMyPlugin\n\nThis will search for a module named \"App::Prove::Plugin::MyPlugin\", or failing that,\n\"MyPlugin\".  If the plugin can't be found, \"prove\" will complain & exit.\n\nYou can pass arguments to your plugin by appending \"=arg1,arg2,etc\" to the plugin name:\n\nprove -PMyPlugin=fou,du,fafa\n\nPlease check individual plugin documentation for more details.\n",
            "subsections": [
                {
                    "name": "Available Plugins",
                    "content": "For an up-to-date list of plugins available, please check CPAN:\n\n<http://search.cpan.org/search?query=App%3A%3AProve+Plugin>\n"
                },
                {
                    "name": "Writing Plugins",
                    "content": "Please see \"PLUGINS\" in App::Prove.\n\n\n\nperl v5.34.0                                 2025-07-25                                     PROVE(1)"
                }
            ]
        }
    },
    "summary": "prove - Run tests through a TAP harness.",
    "flags": [],
    "examples": [],
    "see_also": []
}