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::LOGGER (3)

.ds Aq ’

NAME

Test::Mini::Logger - Output Logger Base Class

CONTENTS

DESCRIPTION

Whether you’re using a tool that expects output in a certain format, or you just long for the familiar look and feel of another testing framework, this is what you’re looking for.

METHODS

    Attribute Accessors

<B>bufferB>


    buffer($self) # => IO



Output buffer.

Returns:
o (IO) — Output buffer.

<B>verboseB>


    verbose($self)



Logger verbosity.

Returns:
o Logger verbosity.

    Output Functions

<B>printB>


    print($self, @msg)



Write output to the #buffer. Lines will be output without added newlines.

Parameters:
o <B>B>@msg<B>B> — The message(s) to be printed; will be handled as per print.

<B>sayB>


    say($self, @msg)



Write output to the #buffer. Lines will be output with appended newlines.

Parameters:
o <B>B>@msg<B>B> — The message(s) to be printed; newlines will be appended to each message, before being passed to #print.

    Callbacks

<B>begin_testB>


    begin_test($self, $tc, $test)



Called before each test is run.

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 being run.

<B>begin_test_caseB>


    begin_test_case($self, $tc, @tests)



Called before each test case is run.

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

<B>begin_test_suiteB>


    begin_test_suite($self, %args)



Called before the test suite is run.

Parameters:
o (Hash) <B>B>%args<B>B> — Options the test suite was run with.

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

<B>errorB>


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



Called when a test dies with an error. Increments the error count.

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)



Called when a test fails. Increments the failure count.

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>finish_testB>


    finish_test($self, $tc, $test, $assertions)



Called after each test is run. Increments the test and assertion counts, and finalizes the test’s timing.

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 just run.
o (Integer) <B>B>$assertions<B>B> — The number of assertions called.

<B>finish_test_caseB>


    finish_test_case($self, $tc, @tests)



Called after each test case is run. Increments the test case count, and finalizes the test case’s timing.

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

<B>finish_test_suiteB>


    finish_test_suite($self, $exit_code)



Called after each test suite is run. Finalizes the test suite timing.

Parameters:
o (Integer) <B>B>$exit_code<B>B> — Status the tests finished with.

<B>passB>


    pass($self, $tc, $test)



Called when a test passes. Increments the pass count.

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)



Called when a test is skipped. Increments the skip count.

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.

    Statistics

<B>countB>


    count # => Hash
    count($key) # => Number



Accessor for counters.

Overloads:



    count # => Hash



  The count hash.

Returns:
o (Hash) — The count hash.

 



    count($key) # => Number



  The value for the given key.

Parameters:
o <B>B>$key<B>B> — A key in the count hash.

 

Returns:
o (Number) — The value for the given key.

 

<B>timeB>


    time($self, $key) # => Number



Accessor for the timing data.

Parameters:
o <B>B>$key<B>B> — The key to look up timings for. Typical values are:
<B>B>$self<B>B> Time for test suite
<B>‘‘TestCase’’B> Time for the test case
<B>‘‘TestCase#test’’B> Time for the given test

Times for units that have not finished should not be relied upon.

Returns:
o (Number) — The time taken by the given argument, in seconds.

    Class Methods

<B>newB>


    new($class, %args)



Constructor.

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 (IO) <B>bufferB> — Output buffer. Defaults to STDOUT.

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


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

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