logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Test2::Harness::Runner::DepTracer - Tool for tracing module dependencies as they are loaded.

Attributes

       These can be specified at construction, and will be populated during use.

       $hashref = $dt->exclude
           A  hashref  of  files/modules  to  exclude  from dep tracking. By default "strict" and "warnings" are
           excluded.

       $hashref = $dt->dep_map
           Every file which is loaded while the tool is started will have an entry in this hash, each  value  is
           an array of all files which loaded the key file directly or indirectly.

       $hashref = $dt->loaded
           How many times each file was directly loaded.

Authors

       Chad Granum <exodist@cpan.org>

Class Methods

       $dt_or_undef = Test2::Harness::Runner::DepTracer->ACTIVE();
           Get the currently active DepTracer, if any.

Description

       This tool is used by Test2::Harness to build a graph of dependancies which can then be used to blacklist
       modified modules (and anything thatuses them) when they change under a preloaded runner.

Maintainers

       Chad Granum <exodist@cpan.org>

Methods

       $dt->start
           Start tracking modules which are loaded.

       $dt->stop
           Stop tracking moduels that are loaded.

Name

       Test2::Harness::Runner::DepTracer - Tool for tracing module dependencies as they are loaded.

Source

       The source code repository for Test2-Harness can be found at http://github.com/Test-More/Test2-Harness/.

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";

See Also