Test::...encies(3pm)

πŸ“¦
version 0.34 Β· 6 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay so the manual page is literally titled Test::...encies(3pm) β€” yes bestie, it's truncated, it's giving mysterious πŸ’€ β€” and the module behind it is Test::Dependencies. Its whole entire job? Making sure your dependency listing is complete. That's the mission. No cap.


✨ VERSION ✨

Version 0.34 πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

drop this lil guy into your t/00-dependencies.t and you're so back:

use CPAN::Meta;  # or CPAN::Meta::cpanfile
use File::Find::Rule::Perl;

use Test::More;
use Test::Dependencies '0.28' forward_compatible => 1;

my $meta = CPAN::Meta->load_file('META.json'); # or META.yml
plan skip_all => 'No META.json' if ! $meta;

my @files = File::Find::Rule::Perl->perl_files->in('./lib', './bin');
ok_dependencies($meta, \@files, [qw/runtime configure build test/],
                undef, # all features in the cpanfile
                ignores => [ qw/ Your::Namespace Some::Other::Namespace / ]
);

done_testing;

🌸 DESCRIPTION 🌸

It makes sure that every single module you use is actually listed as a dependency in your Makefile.PL. That's it. That's the vibe check. If you forgot one, it will absolutely tell you. 🫢


πŸ’… OPTIONS πŸ’…

DEPRECATED β€” you can pass options to the module through the use line, but heads up, these options are getting moved over to the ok_dependencies() function. So they're on their way out. Periodt.

The available options are:

  • forward_compatible β€” when you specify it and it's true, the module stops outputting a plan. That's the default mode of operation once this module becomes 1.0. πŸ‘‘
  • exclude β€” the list of namespaces where it's, like, totally okay to not have dependencies specified. No notes, we move.
  • style β€” DEPRECATED πŸ’€ There used to be an option where you could specify a style; the heavy style depended on B::PerlReq. That module stopped working somewhere around Perl 5.20. So specifying a style no longer has any effect whatsoever. Rip to it fr.

πŸ‘‘ EXPORTED FUNCTIONS πŸ‘‘

ok_dependencies($meta, $files, $phases, $features, %options)

  • $meta is a CPAN::Meta object
  • $files is an arrayref with files to be scanned

%options keys

  • phases β€” an arrayref holding one or more names of phases as defined by CPAN::Meta::Spec, or undef for all of them
  • features β€” an arrayref holding zero or more names of features, or undef for all of them
  • ignores β€” an arrayref listing the names of modules (and their sub-namespaces) for which no errors are to be reported ✨

ok_dependencies()

Deprecated. Legacy invocation, it's getting removed, it's giving retirement party. πŸŽ€ In previous versions, this function would scan the entire bin/, lib/ and t/ subtrees, with the exception of a few sub-directories known to be used by version control systems.

That behaviour has been changed: as of 0.20, Find::File::Rule::Perl is being used to find Perl files (*.pl, *.pm, *.t and those starting with a shebang line referring to perl). Iconic behaviour honestly.


🌈 AUTHORS 🌈

  • Jesse Vincent <jesse at bestpractical.com>
  • Alex Vandiver <alexmv at bestpractical.com>
  • Zev Benjamin <zev at cpan.org>
  • Erik Huelsmann <ehuels at gmail.com>

the whole squad, we love to see it 🫢


πŸ’€ BUGS πŸ’€

  • Test::Dependencies does not track module version requirements. 😭 that's the one thing it won't catch for you.

please report your bugs on GitHub:

L<https://github.com/ehuelsmann/perl-Test-Dependencies/issues>

🫢 SUPPORT 🫢

you can find documentation for this module with the perldoc command:

perldoc Test::Dependencies

you can also look for information at:


Copyright (c) 2016-2023, Erik Huelsmann. All rights reserved.
Copyright (c) 2007, Best Practical Solutions, LLC. All rights reserved.

This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself. See perlartistic.

DISCLAIMER OF WARRANTY

okay so this next part is the legally-required yelling section, and I am NOT paraphrasing it because lawyers are watching πŸ’€ read it as-is:

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.


and that's the whole page bestie πŸ’– this one's perl v5.40.0, dated 2024-11-15, and it lives under the name Test::...encies(3pm). go make your dependencies complete, ily, mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from