App::Prove man page on Archlinux

Man page or keyword search:  
man Server   11224 pages
apropos Keyword Search (all sections)
Output format
Archlinux logo
[printable version]

App::Prove(3perl)      Perl Programmers Reference Guide	     App::Prove(3perl)

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

       Version 3.26

       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.

	   use App::Prove;

	   my $app = App::Prove->new;

   Class Methods

       Create a new "App::Prove". Optionally a hash ref of attribute
       initializers may be passed.


       Getter/setter for the name of the class used for maintaining state.
       This class should either subclass from "App::Prove::State" or provide
       an identical interface.


       Getter/setter for the instance of the "state_class".



       Called before "process_args" to prepend the contents of an rc file to
       the options.



       Processes the command-line arguments. Attributes will be set
       appropriately. Any filenames may be found in the "argv" attribute.

       Dies on invalid arguments.


       Perform whatever actions the command line args specified. The "prove"
       command line tool consists of the following code:

	   use App::Prove;

	   my $app = App::Prove->new;
	   exit( $app->run ? 0 : 1 );  # if you need the exit code


       Load a harness replacement class.

	 $prove->require_harness($for => $class_name);


       Display the version numbers of the loaded TAP::Harness and the current

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


       "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' )

       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

   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;


       prove, TAP::Harness

perl v5.18.2			  2014-01-06		     App::Prove(3perl)

List of man pages available for Archlinux

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net