Test2::Harness::Auditor::Watcher - Class to monitor events for a single job and pass judgement on the result.
This module represents a per-job state tracker. This module sees every event and manages the state produced. In the end this tracker determines if a test job passed or failed, and why.
use Test2::Harness::Auditor::Watcher; my $watcher = Test2::Harness::Auditor::Watcher->new(); for my $event (@events) { $watcher->process($event); } print "Pass!" if $watcher->pass; print "Fail!" if $watcher->fail;
Number of assertions that have been seen.
If the job has exited this will return the exit value (integer, 0 or greater). If the job has not exited yet (or at least if the watcher has not seen the exit event yet) this will return undef.
Returns true if the job has failed/is failing.
Used internally to get a list of 'error' facets to inject into the harness_job_exit event.
If the test file is known this will return it (string). This will return undef if the file is not yet known.
If the test was halted (bail-out) this will contain the human readible reason.
Check if the exit value is known.
Check if a plan has been seen.
If the job is known this will return the detailed structure of the job.
If this watcher represents a subtest this will be an integer greater than 0, the top-level test is 0.
This is an internal state tracking what test numbers have been seen. This is really only applicable in tests that produced TAP.
Check if the test job is passing.
If the plan facet has been seen this will return it.
Modify the state based on the provided event.
Retuns the Test2::Harness::Auditor::TimeTracker instance.
Sometimes a job is run more than once, in those cases this will be an integer greater than 0 representing the try. 0 is used for the first try.
The source code repository for Test2-Harness can be found at http://github.com/Test-More/Test2-Harness/.
Copyright 2020 Chad Granum <exodist7@gmail.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://dev.perl.org/licenses/
To install Test2::Harness, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test2::Harness
CPAN shell
perl -MCPAN -e shell install Test2::Harness
For more information on module installation, please visit the detailed CPAN module installation guide.