UR::Namespace::Command::Test::Callcount(3pm) | User Contributed Perl Documentation | UR::Namespace::Command::Test::Callcount(3pm) |
ur test callcount - collect callcount data from running tests into one file
# run tests in a given namespace cd my_sandbox/TheApp ur test run --recurse --callcount ur test callcount --output all_tests.callcount
Callcount data can be used to find unused subroutines in your code. When the test suite is run with the "callcount" option, then for each *.t file run by the test suite, a corresponding *.callcount file is created containing information about how often all the defined subroutines were called.
The callcount file is a plain text file with three columns:
After a test suite run with sufficient coverage, subroutines with 0 calls are candidates for removal, and subs with high call counts are candidates for optimization.
After inputs are determined, any directories given are expanded by searching them recursively for files ending in .callcount with File::Find.
If no inputs in any form are given, then it defaults to '.', the current directory, which means all *.callcount files under the current directory are used.
The "execute()" method returns an arrayref of data sorted in the appropriate way. Each element is itself an arrayref of three items: count, sub name, and sub location.
2022-01-17 | perl v5.32.1 |