Test2:...atcher(3pm)
π Test2::Harness::Auditor::Watcher β the vibe check for one single test job
okay so bestie, this page is Test2:...atcher(3pm) β which is the manual entry for Test2::Harness::Auditor::Watcher, sitting in the User Contributed Perl Documentation corner of perl section 3pm. Yes, the title got clipped like a bad fringe. It's the Watcher. Let's go. π¦
β¨ NAME β¨
Test2::Harness::Auditor::Watcher β Class to monitor events for a single job and pass judgement on the result.
Like, it's literally the judge. Not the β¨judgyβ¨ kind, the actual kind that decides pass or fail.
πΈ DESCRIPTION πΈ
This module represents a per-job state tracker. That's the whole thing, and honestly? It ate.
This module sees every event and manages the state produced. Every. Single. One. It's giving surveillance but make it productive π
In the end this tracker determines if a test job passed or failed, and why. The "and why" part is the main character energy here β it's not just vibes, it's receipts.
β SYNOPSIS β
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;
look at that. feed it events, ask it for the tea at the end. slay. π
π METHODS π
okay here's the whole roster, no skips, I promise bestie π«Ά
$int = $watcher->assertion_count()β Number of assertions that have been seen. Just counting them. Every last one. π$exit = $watcher->exit()β If the job has exited this will return the exit value (integer,0or greater). If the job has not exited yet (or at least if the watcher has not seen the exit event yet) this will returnundef. Soundef= "don't know yet, hold on." π°οΈ$bool = $watcher->fail()β Returns true if the job has failed/is failing. π@error_facets = $watcher->fail_error_facet_listβ Used internally to get a list of'error'facets to inject into theharness_job_exitevent. Internal business, iykyk.$file = $watcher->fileβ If the test file is known this will return it (string). This will returnundefif the file is not yet known. Mystery file era π$string = $watcher->haltβ If the test was halted (bail-out) this will contain the human readible reason. Yes, the test can just leave, and this is the note it left behind π$bool = $watcher->has_exitβ Check if the exit value is known.$bool = $watcher->has_planβ Check if a plan has been seen. Plans are iconic, we love a plan β¨$job = $watcher->jobβ If the job is known this will return the detailed structure of the job.$int = $watcher->nestedβ If this watcher represents a subtest this will be an integer greater than0; the top-level test is0. So0= main character, anything above0= the supporting cast π$hash = $watcher->numbersβ This is an internal state tracking what test numbers have been seen. This is really only applicable in tests that produced TAP.$bool = $watcher->passβ Check if the test job is passing. π€$plan_facet = $watcher->plan()β If the plan facet has been seen this will return it.$watcher->process($event);β Modify the state based on the provided event. This is the one you call in the loop, bestie. Every event. In order. Don't skip π¨$watcher->subtest_fail_error_facet_listβ Used internally to get a list of'error'facets to inject into theharness_job_exitevent. The subtest-flavoured sibling of the one above.$times = $watcher->times()β Retuns theTest2::Harness::Auditor::TimeTrackerinstance. (Typo's canon, we don't fix canon π )$int = $watcher->try()β Sometimes a job is run more than once, in those cases this will be an integer greater than0representing the try.0is used for the first try. Round one is always0, king behavior π
π₯ SOURCE π₯
The source code repository for Test2-Harness can be found at http://github.com/Test-More/Test2-Harness/
π MAINTAINERS π
Chad Granum <exodist@cpan.org>
π AUTHORS π
Chad Granum <exodist@cpan.org>
π COPYRIGHT π
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/
aaaaand that's the whole page bestie, no cap, nothing skipped π this was generated against perl v5.40.1 and dated 2026-05-10, and yeah the footer still says Test2:...atcher(3pm) because the title truncation is forever iconic π
mwah, go forth and watch some events π¦
π¦ where this page comes from
- ubuntu stonking: libtest2-harness-perl 1.000172-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms