man > App::Prove

📛 NAME

App::Prove - Implements the "prove" command.

🚀 Quick Reference

Use CaseCommandDescription
Run all testsproveExecute tests in t/ directory
Include lib/prove -lAdd lib/ to @INC
Verbose outputprove -vShow detailed test output
Quiet modeprove -qSuppress some output
Super quietprove -QOnly print test summary
Parallel jobsprove -j4Run tests with 4 parallel jobs
Recurse dirsprove -rRecurse into subdirectories
Shuffle testsprove --shuffleRandomise test order
State save/restoreprove --state=save,hotRun failed/pending tests first
Custom formatterprove -PMyPluginUse plugin App::Prove::Plugin::MyPlugin

🔄 VERSION

Version 3.43

📖 DESCRIPTION

Test::Harness provides a command, "prove", which runs a TAP based test suite and prints a report. The "prove" command is a minimal wrapper around an instance of this module.

📋 SYNOPSIS

use App::Prove;

my $app = App::Prove->new;
$app->process_args(@ARGV);
$app->run;

⚙️ METHODS

🔧 Class Methods

🏷️ Attributes

After command line parsing the following attributes reflect the values of the corresponding command line switches. They may be altered before calling run.

🧩 PLUGINS

App::Prove provides support for 3rd-party plugins. These are currently loaded at run-time, after arguments have been parsed (so you can not change the way arguments are processed, sorry), typically with the -Pplugin switch, eg:

prove -PMyPlugin

This will search for a module named App::Prove::Plugin::MyPlugin, or failing that, MyPlugin. If the plugin can't be found, prove will complain & exit.

You can pass an argument to your plugin by appending an = after the plugin name, eg -PMyPlugin=foo. You can pass multiple arguments using commas:

prove -PMyPlugin=foo,bar,baz

These are passed in to your plugin's load() class method (if it has one), along with a reference to the App::Prove object that is invoking your plugin:

sub load {
    my ($class, $p) = @_;

    my @args = @{ $p->{args} };
    # @args will contain ( 'foo', 'bar', 'baz' )
    $p->{app_prove}->do_something;
    ...
}

Note that the user's arguments are also passed to your plugin's import() function as a list, eg:

sub import {
    my ($class, @args) = @_;
    # @args will contain ( 'foo', 'bar', 'baz' )
    ...
}

This is for backwards compatibility, and may be deprecated in the future.

💡 Sample Plugin

Here's a sample plugin, for your reference:

package App::Prove::Plugin::Foo;

# Sample plugin, try running with:
# prove -PFoo=bar -r -j3
# prove -PFoo -Q
# prove -PFoo=bar,My::Formatter

use strict;
use warnings;

sub load {
    my ($class, $p) = @_;
    my @args = @{ $p->{args} };
    my $app  = $p->{app_prove};

    print "loading plugin: $class, args: ", join(', ', @args ), "\n";

    # turn on verbosity
    $app->verbose( 1 );

    # set the formatter?
    $app->formatter( $args[1] ) if @args > 1;

    # print some of App::Prove's state:
    for my $attr (qw( jobs quiet really_quiet recurse verbose )) {
        my $val = $app->$attr;
        $val    = 'undef' unless defined( $val );
        print "$attr: $val\n";
    }

    return 1;
}

1;

📚 SEE ALSO

prove, TAP::Harness

App::Prove
📛 NAME 🚀 Quick Reference 🔄 VERSION 📖 DESCRIPTION 📋 SYNOPSIS ⚙️ METHODS
🔧 Class Methods 🏷️ Attributes
🧩 PLUGINS
💡 Sample Plugin
📚 SEE ALSO

Generated by phpman v4.9.22-1-g1b0fcb4 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-05 09:04 @216.73.216.52
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-pro / taotoken.net / www.chedong.com - original format

^_top_^