App::Prove



App::Prove

NAME
VERSION
DESCRIPTION
SYNOPSIS
METHODS
PLUGINS
SEE ALSO

NAME

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

VERSION

Version 3.23

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
"new"

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

"state_class"

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.

"state_manager"

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

"add_rc_file"

    $prove−>add_rc_file('myproj/.proverc');

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

"process_args"

    $prove−>process_args(@args);

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

Dies on invalid arguments.

"run"

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;
    $app−>process_args(@ARGV);
    exit( $app−>run ? 0 : 1 );  # if you need the exit code

"require_harness"

Load a harness replacement class.

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

"print_version"

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

Attributes
After command line parsing the following attributes reflect the values of the corresponding command line switches. They may be altered before calling "run".
"archive"
"argv"
"backwards"
"blib"
"color"
"directives"
"dry"
"exec"
"extensions"
"failures"
"comments"
"formatter"
"harness"
"ignore_exit"
"includes"
"jobs"
"lib"
"merge"
"modules"
"parse"
"plugins"
"quiet"
"really_quiet"
"recurse"
"rules"
"show_count"
"show_help"
"show_man"
"show_version"
"shuffle"
"state"
"state_class"
"taint_fail"
"taint_warn"
"test_args"
"timer"
"verbose"
"warnings_fail"
"warnings_warn"
"tapversion"
"trap"

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



More Linux Commands

manpages/sm-notify.8.html
sm-notify(8) - send reboot notifications to NFS peers.......
File locks are not part of persistent file system state. Lock state is thus lost when a host reboots. Network file systems must also detect when lock state is l

manpages/sudo.conf.5.html
sudo.conf(5) configuration for sudo front end (Man Page)....
The sudo.conf file is used to configure the sudo front end. It specifies the security policy and I/O logging plugins, debug flags as well as plugin-agnostic pat

manpages/Mail::SPF::Mech.3pm.html
Mail::SPF::Mech(3pm) - SPF record mechanism base class......
An object of class Mail::SPF::Mech represents a mechanism within an SPF record. Mail::SPF::Mech cannot be instantiated directly. Create an instance of a concret

manpages/wsyncup.3ncurses.html
wsyncup(3ncurses) - create curses windows - Linux man page
Calling newwin creates and returns a pointer to a new window with the given number of lines and columns. The upper left-hand corner of the window is at line beg

manpages/threads::shared.3pm.html
threads::shared(3pm) - Perl extension for sharing data struc
By default, variables are private to each thread, and each newly created thread gets a private copy of each existing variable. This module allows you to share v

manpages/has_il_sp.3ncurses.html
has_il_sp(3ncurses) - curses screen-pointer extension.......
This implementation can be configured to provide a set of functions which improve the ability to manage multiple screens. This feature can be added to any of th

manpages/sk98lin.4.html
sk98lin(4) - Marvell/SysKonnect Gigabit Ethernet driver v6.2
Note: This obsolete driver was removed from the kernel in version 2.6.26. sk98lin is the Gigabit Ethernet driver for Marvell and SysKonnect network adapter card

manpages/TAP::Parser::Scheduler::Spinner.3pm.html
TAP::Parser::Scheduler::Spinner(3pm) - A no-op job..........
A no-op job. Returned by TAP::Parser::Scheduler as an instruction to the harness to spin (keep executing tests) while the scheduler cant return a real job. METH

manpages/catopen.3.html
catopen(3) - open/close a message catalog - Linux man page
The function catopen() opens a message catalog and returns a catalog descriptor. The descriptor remains valid until catclose() or execve(2). If a file descripto

manpages/cvslock.1.html
cvslock(1) - lock CVS repositories - Linux manual page......
cvslock is used to lock a tree starting at directory in your CVS repository during low-level manipulation or inspection. There are various modes of operation: Y

manpages/gluTessBeginPolygon.3gl.html
gluTessBeginPolygon(3gl) - delimit a polygon description....
gluTessBeginPolygon.3gl - gluTessBeginPolygon and gluTessEndPolygon delimit the definition of a convex, concave or self-intersecting polygon. Within each gluTes

manpages/snmp_send.3.html
snmp_send(3) - netsnmp_session_api functions (Man Page).....
Snmp_sess_init prepares a netsnmp_session that sources transport characteristics and common information that will be used for a set of SNMP transactions. After





We can't live, work or learn in freedom unless the software we use is free.