.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Test::DiagINC 3pm" .TH Test::DiagINC 3pm "2022-10-15" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Test::DiagINC \- List modules and versions loaded if tests fail .SH "VERSION" .IX Header "VERSION" version 0.010 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& # preferably load before anything else \& use if $ENV{AUTOMATED_TESTING}, \*(AqTest::DiagINC\*(Aq; \& use Test::More; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Assuming you shipped your module to \s-1CPAN\s0 with working tests, test failures from \&\s-1CPAN\s0 Testers might be due to platform issues, Perl version issues or problems with dependencies. This module helps you diagnose deep dependency problems by showing you exactly what modules and versions were loaded during a test run. .PP When this module is loaded, it sets up an \f(CW\*(C`END\*(C'\fR block that will take action if the program is about to exit with a non-zero exit code or if \&\f(CW$test_builder\fR\->is_passing is false by the time the \f(CW\*(C`END\*(C'\fR block is reached. If that happens, this module prints out the names and version numbers of non-local modules appearing in \&\f(CW%INC\fR at the end of the test. .PP For example: .PP .Vb 10 \& $ perl \-MTest::DiagINC \-MTest::More \-e \*(Aqfail("meh"); done_testing\*(Aq \& not ok 1 \- meh \& # Failed test \*(Aqmeh\*(Aq \& # at \-e line 1. \& 1..1 \& # Looks like you failed 1 test of 1. \& # Listing modules and versions from %INC \& # 5.018002 Config \& # 5.68 Exporter \& # 5.68 Exporter::Heavy \& # 1.07 PerlIO \& # 0.98 Test::Builder \& # 0.98 Test::Builder::Module \& # 0.003 Test::DiagINC \& # 0.98 Test::More \& # 1.22 overload \& # 0.02 overloading \& # 1.07 strict \& # 1.03 vars \& # 1.18 warnings \& # 1.02 warnings::register .Ve .PP This module deliberately does not load \fBany other modules\fR during runtime, instead delaying all loads until it needs to generate a failure report in its \&\f(CW\*(C`END\*(C'\fR block. The only exception is loading strict and warnings for self-check \fBif and only if\fR \f(CW\*(C`RELEASE_TESTING\*(C'\fR is true. Therefore an empty invocation will look like this: .PP .Vb 3 \& $ perl \-MTest::DiagINC \-e \*(Aqexit(1)\*(Aq \& # Listing modules from %INC \& # 0.003 Test::DiagINC .Ve .PP \&\fB\s-1NOTE\s0\fR: Because this module uses an \f(CW\*(C`END\*(C'\fR block, it is a good idea to load it as early as possible, so the \f(CW\*(C`END\*(C'\fR block it installs will execute as \&\fBlate\fR as possible (see perlmod for details on how this works). While this module does employ some cleverness to work around load order, it is still a heuristic and is no substitute to loading this module early. A notable side-effect is when a module is loaded in an \f(CW\*(C`END\*(C'\fR block executing \fBafter\fR the one installed by this library: such modules will be \*(L"invisible\*(R" to us and will not be reported as part of the diagnostic report. .PP Modules that appear to be sourced from below the current directory when \&\f(CW\*(C`Test::DiagINC\*(C'\fR was loaded will be excluded from the report (e.g. excludes local modules from \f(CW\*(C`./\*(C'\fR, \f(CW\*(C`lib/\*(C'\fR, \f(CW\*(C`t/lib\*(C'\fR, and so on). .PP The heuristic of searching \f(CW%INC\fR for loaded modules may fail if the module path loaded does not map to a package within the module file. .PP If \f(CW\*(C`Test::More\*(C'\fR is loaded, the output will go via the \f(CW\*(C`diag\*(C'\fR function. Otherwise, it will just be sent to \s-1STDERR.\s0 .SH "SUPPORT" .IX Header "SUPPORT" .SS "Bugs / Feature Requests" .IX Subsection "Bugs / Feature Requests" Please report any bugs or feature requests through the issue tracker at . You will be notified automatically of any progress on your issue. .SS "Source Code" .IX Subsection "Source Code" This is open source software. The code repository is available for public review and contribution under the terms of the license. .PP .PP .Vb 1 \& git clone https://github.com/dagolden/Test\-DiagINC.git .Ve .SH "AUTHOR" .IX Header "AUTHOR" David Golden .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" .IP "\(bu" 4 Graham Knop .IP "\(bu" 4 Peter Rabbitson .IP "\(bu" 4 Roy Ivy \s-1III\s0 .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2014 by David Golden. .PP This is free software, licensed under: .PP .Vb 1 \& The Apache License, Version 2.0, January 2004 .Ve