Test::Mini::Logger - Output Logger Base Class
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.
buffer($self) # => IO
Output buffer.
Returns:
(IO) -- Output buffer.
verbose($self)
Logger verbosity.
print($self, @msg)
Write output to the #buffer. Lines will be output without added newlines.
Parameters:
@msg -- The message(s) to be printed; will be handled as per print.
@msg
print
say($self, @msg)
Write output to the #buffer. Lines will be output with appended newlines.
@msg -- The message(s) to be printed; newlines will be appended to each message, before being passed to #print.
begin_test($self, $tc, $test)
Called before each test is run.
(Class) $tc -- The test case owning the test method.
$tc
(String) $test -- The name of the test method being run.
$test
begin_test_case($self, $tc, @tests)
Called before each test case is run.
(Class) $tc -- The test case being run.
(Array<String>) @tests -- A list of tests to be run.
@tests
begin_test_suite($self, %args)
Called before the test suite is run.
(Hash) %args -- Options the test suite was run with.
%args
Valid Options for %args:
(String) filter -- Test name filter.
(String) seed -- Randomness seed.
error($self, $tc, $test, $e)
Called when a test dies with an error. Increments the error count.
(String) $test -- The name of the test with an error.
(Test::Mini::Exception) $e -- The exception object.
$e
fail($self, $tc, $test, $e)
Called when a test fails. Increments the failure count.
(String) $test -- The name of the failed test.
(Test::Mini::Exception::Assert) $e -- The exception object.
finish_test($self, $tc, $test, $assertions)
Called after each test is run. Increments the test and assertion counts, and finalizes the test's timing.
(String) $test -- The name of the test method just run.
(Integer) $assertions -- The number of assertions called.
$assertions
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.
(Class) $tc -- The test case just run.
(Array<String>) @tests -- A list of tests run.
finish_test_suite($self, $exit_code)
Called after each test suite is run. Finalizes the test suite timing.
(Integer) $exit_code -- Status the tests finished with.
$exit_code
pass($self, $tc, $test)
Called when a test passes. Increments the pass count.
(String) $test -- The name of the passing test.
skip($self, $tc, $test, $e)
Called when a test is skipped. Increments the skip count.
(String) $test -- The name of the skipped test.
(Test::Mini::Exception::Skip) $e -- The exception object.
count # => Hash count($key) # => Number
Accessor for counters.
Overloads:
count # => Hash
The count hash.
(Hash) -- The count hash.
count($key) # => Number
The value for the given key.
$key -- A key in the count hash.
$key
(Number) -- The value for the given key.
time($self, $key) # => Number
Accessor for the timing data.
$key -- The key to look up timings for. Typical values are:
$self
Time for test suite
Time for the test case
Time for the given test
Times for units that have not finished should not be relied upon.
(Number) -- The time taken by the given argument, in seconds.
new($class, %args)
Constructor.
(Hash) %args -- Initial state for the new instance.
verbose -- Logger verbosity. Defaults to 0.
0
(IO) buffer -- Output buffer. Defaults to STDOUT.
STDOUT
To install Test::Mini, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Mini
CPAN shell
perl -MCPAN -e shell install Test::Mini
For more information on module installation, please visit the detailed CPAN module installation guide.