Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Test::Mini::Logger(3) User Contributed Perl DocumentationTest::Mini::Logger(3)

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

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
       buffer
	       buffer($self) # => IO

	   Output buffer.

	   Returns:

	   o   (IO) -- Output buffer.

       verbose
	       verbose($self)

	   Logger verbosity.

	   Returns:

	   o   Logger verbosity.

   Output Functions
       print
	       print($self, @msg)

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

	   Parameters:

	   o   @msg -- The message(s) to be printed; will be handled as	per
	       "print".

       say
	       say($self, @msg)

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

	   Parameters:

	   o   @msg -- The message(s) to be printed; newlines will be appended
	       to each message,	before being passed to #print.

   Callbacks
       begin_test
	       begin_test($self, $tc, $test)

	   Called before each test is run.

	   Parameters:

	   o   (Class) $tc -- The test case owning the test method.

	   o   (String)	$test -- The name of the test method being run.

       begin_test_case
	       begin_test_case($self, $tc, @tests)

	   Called before each test case	is run.

	   Parameters:

	   o   (Class) $tc -- The test case being run.

	   o   (Array_String_) @tests -- A list	of tests to be run.

       begin_test_suite
	       begin_test_suite($self, %args)

	   Called before the test suite	is run.

	   Parameters:

	   o   (Hash) %args -- Options the test	suite was run with.

	   Valid Options for %args:

	   o   (String)	filter -- Test name filter.

	   o   (String)	seed --	Randomness seed.

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

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

	   Parameters:

	   o   (Class) $tc -- The test case owning the test method.

	   o   (String)	$test -- The name of the test with an error.

	   o   (Test::Mini::Exception) $e -- The exception object.

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

	   Called when a test fails. Increments	the failure count.

	   Parameters:

	   o   (Class) $tc -- The test case owning the test method.

	   o   (String)	$test -- The name of the failed	test.

	   o   (Test::Mini::Exception::Assert) $e -- The exception object.

       finish_test
	       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) $tc -- The test case owning the test method.

	   o   (String)	$test -- The name of the test method just run.

	   o   (Integer) $assertions --	The number of assertions called.

       finish_test_case
	       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) $tc -- The test case just run.

	   o   (Array_String_) @tests -- A list	of tests run.

       finish_test_suite
	       finish_test_suite($self,	$exit_code)

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

	   Parameters:

	   o   (Integer) $exit_code -- Status the tests	finished with.

       pass
	       pass($self, $tc,	$test)

	   Called when a test passes. Increments the pass count.

	   Parameters:

	   o   (Class) $tc -- The test case owning the test method.

	   o   (String)	$test -- The name of the passing test.

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

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

	   Parameters:

	   o   (Class) $tc -- The test case owning the test method.

	   o   (String)	$test -- The name of the skipped test.

	   o   (Test::Mini::Exception::Skip) $e	-- The exception object.

   Statistics
       count
	       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   $key	-- A key in the	count hash.

	       Returns:

	       o   (Number) -- The value for the given key.

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

	   Accessor for	the timing data.

	   Parameters:

	   o   $key -- The key to look up timings for.	Typical	values are:

	       $self
		   Time	for test suite

	       "TestCase"
		   Time	for the	test case

	       "TestCase#test"
		   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
       new
	       new($class, %args)

	   Constructor.

	   Parameters:

	   o   (Hash) %args -- Initial state for the new instance.

	   Valid Options for %args:

	   o   verbose -- Logger verbosity.  Defaults to 0.

	   o   (IO) buffer -- Output buffer.  Defaults to "STDOUT".

perl v5.32.1			  2011-02-13		 Test::Mini::Logger(3)

NAME | DESCRIPTION | METHODS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Test::Mini::Logger&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help