TB2::Counter - Counts the number of tests run
use TB2::Counter; my $counter = TB2::Counter->new; $counter->increment; $counter->set($count); $counter->get;
This object simply contains the count of the number of tests run as a simple positive integer.
Most testing systems don't care how many tests run, but this is very important for TAP output.
The counter is normally used through TB2::History, but you can get it separately if you want to be really slim.
my $counter = TB2::Counter->new;
Creates a brand new counter starting at 0.
my $count = $counter->increment; my $count = $counter->increment($amount);
Increments the counter by $amount or 1 if $amount is not given.
Returns the new $count.
my $count_was = $counter->set($count);
Sets the counter to $count.
Return what the $count_was.
my $count = $counter->get;
Gets the $count.