Test2:...pTracer(3pm)
β¨ NAME β¨
Test2::Harness::Runner::DepTracer β a whole tool for tracing module dependencies as they get loaded π (it lives in the User Contributed Perl Documentation, manual page Test2:...pTracer(3pm), bestie, don't lose it)
π¦ DESCRIPTION π¦
okay so this tool is used by Test2::Harness to build up a graph of dependencies, and then that graph gets used to blacklist modified modules β and literally anything that uses them β whenever they change under a preloaded runner. it's giving "we know who loaded you and we are NOT letting you sneak back in" energy π
πΈ SYNOPSIS πΈ
use Test2::Harness::Runner::DepTracer;
my $dt = Test2::Harness::Runner::DepTracer->new();
$dt->start();
require Some::Thing;
# You can always check for and retrieve an active DepTrace this way:
my $dt_reference = Test2::Harness::Runner::DepTracer->ACTIVE;
$dt->stop();
my $dep_map = $dt->dep_map;
my $loaded_by = $dep_map->{'Some/Thing.pm'};
print "Some::Thing was directly or indirectly loaded by:\n" . join("\n" => @$loaded_by) . "\n";
π ATTRIBUTES π
these can be specified at construction time, and then they get populated during use β¨
$hashref = $dt->excludeβ a hashref of files/modules you want excluded from dep tracking. by default,"strict"and"warnings"are excluded (obviously, they're always there, they're not the moment).$hashref = $dt->dep_mapβ every single file loaded while the tool is started gets an entry in this hash, and each value is an array of all the files that loaded the key file, directly or indirectly. it's the friendship web fr fr πΈοΈ$hashref = $dt->loadedβ how many times each file was directly loaded. the clout counter π
π METHODS π
$dt->startβ start tracking modules that get loaded. go go go π$dt->stopβ stop tracking modules that get loaded. okay that's enough, we're done here π
π CLASS METHODS π
$dt_or_undef = Test2::Harness::Runner::DepTracer->ACTIVE();β grab the currently activeDepTracer, if there even is one. might beundef, no cap.
π«Ά SOURCE π«Ά
the source code repository for Test2-Harness lives at http://github.com/Test-More/Test2-Harness/. go look, it's iconic.
π 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/
and that's the whole page, bestie π₯° perl v5.40.1, dated 2026-05-10, straight out of the Test2:...pTracer(3pm) manual. slay, go trace some dependencies π
β¨πΈ
π¦ 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