Test::Builder2::History - Manage the history of test results
use Test::Builder2::History; # This is a shared singleton object my $history = Test::Builder2::History->singleton; my $result = Test::Builder2::Result->new_result( pass => 1 ); $history->accept_result( $result ); $history->is_passing;
This object stores and manages the history of test results.
my $history = Test::Builder2::History->singleton; Test::Builder2::History->singleton($history);
Gets/sets the shared instance of the history object.
Test::Builder2::History is a singleton. singleton() will return the same object every time so all users can have a shared history. If you want your own history, call create() instead.
my $history = Test::Builder2::History->create;
Creates a new, unique History object.
Unless otherwise stated, these are all accessor methods of the form:
my $value = $history->method; # get $history->method($value); # set
A Test::Builder2::Stack of events, that include Result objects.
Push an event to the events stack.
Get the count of events that are on the stack.
A Test::Builder2::Stack of Result objects.
# The result of test #4. my $result = $history->results->[3];
Add a result object to the end stack,
Get the count of results stored in the stack.
NOTE: This could be diffrent from the number of tests that have been seen, to get that count use test_count.
Returns true if we have stored results, false otherwise.
A count of the number of tests that have been added to results. This value is not guaranteed to be the same as results_count if you have altered the results_stack. This is a static counter of the number of tests that have been seen, not the number of results stored.
A count of the number of passed tests have been added to results.
A count of the number of failed tests have been added to results.
A count of the number of TODO tests have been added to results.
A count of the number of SKIP tests have been added to results.
Returns true if we have not yet seen a failing test.
$history->consume($old_history);
Appends $old_history results in to $history's results stack.
To install Test::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Simple
CPAN shell
perl -MCPAN -e shell install Test::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.