GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TEST::MINI::RUNNER (3)

.ds Aq ’

NAME

Test::Mini::Runner - Default Test Runner

CONTENTS

DESCRIPTION

The Test::Mini::Runner is responsible for finding and running the appropriate tests, setting up output logging, and returning an appropriate status code. For those looking to write tests with this framework, the points of note are as follows:
o Tests are run automatically at process exit.
o All test cases (subclasses of Test::Mini::TestCase) that have been loaded at that time will be considered. This includes indirect subclasses.
o Within each test case, all methods defined with a name matching /^test.+/ will be run.
o Each test will run in its own test case instance.
o Tests will be run in random order.
o #setup will be called before each test is run.
o #teardown will be called after each test is run.
o Inherited tests are <B>notB> run.
o Tests may be run via `prove`, by loading (via use, do or require) the files into another script, or by simply executing a file containing a test case in the Perl interpreter.
o If you want to use a non-TAP output logger, `prove` is not an option.
o Options may be passed in either as command line options, or as environment variables.
o Environment variable names are prefixed with ’TEST_MINI_’.
o Valid options are:
o verbose - Specifies the logger’s verbosity.
o filter - Only tests with names matching this pattern should be run.
o logger - Specifies an alternate output logger class.
o seed - Specifies a random number seed; used to specify repeatable test orderings.

METHODS

    Attribute Accessors

<B>exit_codeB>


    exit_code($self)



Exit code, representing the status of the test run.

Returns:
o Exit code, representing the status of the test run.

<B>filterB>


    filter($self)



Test name filter.

Returns:
o Test name filter.

<B>loggerB>


    logger($self)



Logger instance.

Returns:
o Logger instance.

<B>seedB>


    seed($self)



Randomness seed.

Returns:
o Randomness seed.

<B>verboseB>


    verbose($self)



Logger verbosity.

Returns:
o Logger verbosity.

    Test Run Hooks

<B>runB>


    run($self)



Begins the test run. Loads and instantiates the test output logger, then dispatches to #run_test_suite (passing the #filter and #seed, as appropriate).

Returns:
o The result of the #run_test_suite call.

<B>run_testB>


    run_test($self, $tc, $test) # => Integer



Runs a specific test.

Parameters:
o (Class) <B>B>$tc<B>B> — The test case owning the test method.
o (String) <B>B>$test<B>B> — The name of the test method to be run.

Returns:
o (Integer) — The number of assertions called by the test.

<B>run_test_caseB>


    run_test_case($self, $tc, @tests)



Runs tests in a test case.

Parameters:
o (Class) <B>B>$tc<B>B> — The test case to run.
o (Array<String>) <B>B>@tests<B>B> — A list of tests to be run.

<B>run_test_suiteB>


    run_test_suite($self, %args)



Runs the test suite. Finds subclasses of Test::Mini::TestCase, and dispatches to #run_test_case with the name of each test case and a list test methods to be run.

Parameters:
o (Hash) <B>B>%args<B>B>

Valid Options for %args:
o (String) <B>filterB> — Test name filter.
o (String) <B>seedB> — Randomness seed.

Returns:
o The value of #exit_code.

    Callbacks

<B>errorB>


    error($self, $tc, $test, $e)



Callback for dying tests.

Parameters:
o (Class) <B>B>$tc<B>B> — The test case owning the test method.
o (String) <B>B>$test<B>B> — The name of the test with an error.
o (Test::Mini::Exception) <B>B>$e<B>B> — The exception object.

<B>failB>


    fail($self, $tc, $test, $e)



Callback for failing tests.

Parameters:
o (Class) <B>B>$tc<B>B> — The test case owning the test method.
o (String) <B>B>$test<B>B> — The name of the failed test.
o (Test::Mini::Exception::Assert) <B>B>$e<B>B> — The exception object.

<B>passB>


    pass($self, $tc, $test)



Callback for passing tests.

Parameters:
o (Class) <B>B>$tc<B>B> — The test case owning the test method.
o (String) <B>B>$test<B>B> — The name of the passing test.

<B>skipB>


    skip($self, $tc, $test, $e)



Callback for skipped tests.

Parameters:
o (Class) <B>B>$tc<B>B> — The test case owning the test method.
o (String) <B>B>$test<B>B> — The name of the skipped test.
o (Test::Mini::Exception::Skip) <B>B>$e<B>B> — The exception object.

    Class Methods

<B>newB>


    new($class, %args)



Constructor. Arguments may be provided explicitly to the constructor or implicitly via either @ARGV (parsed by Getopt::Long) or environment variables (TEST_MINI_$option).

Parameters:
o (Hash) <B>B>%args<B>B> — Initial state for the new instance.

Valid Options for %args:
o <B>verboseB> — Logger verbosity. Defaults to 0.
o (String) <B>filterB> — Test name filter. Defaults to .
o (Class) <B>loggerB> — Logger class name. Defaults to Test::Mini::Logger::TAP.
o (Integer) <B>seedB> — Randomness seed. Defaults to a random number < 64_000_000 .

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TEST::MINI::RUNNER (3) 2011-02-13

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.