Test::Proto::TestRunner - Embodies a run through a test
my $runner = Test::Proto::TestRunner->new(test_case=>$testCase); my $subRunner $runner->subtest; $subRunner->pass; $runner->done();
Note that it is a Moo class.
Unless otherwise specified, the return value is itself.
All of these attributes are chainable as setters.
Returns the test subject
Returns the test case or the prototype
Returns the parent of the test.
Returns 1 if the test run has finished, 0 otherwise.
1
0
Returns 0 if the test run has failed or exception, 1 otherwise.
If any test case or prototype has one of the tags in this list, the runner will skip it.
If this list is not empty, then unless a test case or prototype has a tag in this list, the runner will skip it.
Returns 1 if the test run has run into an exception, 0 otherwise.
Returns 1 if the result is for information purposes, 0 otherwise.
Returns 1 if the test case was skipped, 0 otherwise.
Returns an arrayref
This is a string which indicates the reason for skipping, exception info, etc.
Returns the formatter used.
$self->complete(0); $self->complete(0, 'Something went wrong');
Declares the test run is complete. It is intended that this is only called by the other methods done, pass, fail, exception, diag, skip.
done
pass
fail
exception
diag
skip
Creates and returns a child, which is another TestRunner. The child keeps the same formatter, subject, and test_case as the parent. The child is added to the parent's list of events.
Adds an event to the runner.
$self->done; $self->done ('Completed check of widgets');
Declares that the test run is complete, and determines if the result is a pass or a fail - if there are any failures, then the result is deemed to be a failure.
$self->pass;
Declares that the test run is complete, and declares the result to be a pass, irrespective of what the results of the subtests were.
$self->fail;
Declares that the test run is complete, and declares the result to be a failure, irrespective of what the results of the subtests were.
$self->diag;
Declares that the test run is complete, and declares that it is not a result but a diagnostic message, irrespective of what the results of the subtests were.
$self->skip;
Declares that the test run is complete, but that it was skipped.
$self->exception;
Declares that the test run is complete, and declares the result to be an exception, irrespective of what the results of the subtests were.
$self->inform_formatter;
Used internally to send events to the formatter. The two events currently permitted are 'new' and 'done'.
$self->status;
Useful to summarise the status of the TestRunner. Possible values are: FAIL, PASS, INFO, SKIPPED, EXCEPTION, INCOMPLETE.
$self->run_test($test, $proto);
This method runs a particular test in the object's script, and returns the subtest. It is called by the Test::Proto::Base::run_tests and should only be called by subclasses of Test::Proto::Base which override that method.
Test::Proto::Base::run_tests
This is documented for information purposes only and is not intended to be used except in the maintainance of Test::Proto itself.
Test::Proto
Test::Proto::TestRunner implements Object::ID. This is used by formatters.
To install Test::Proto, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Proto
CPAN shell
perl -MCPAN -e shell install Test::Proto
For more information on module installation, please visit the detailed CPAN module installation guide.