1 package Test2::API::Breakage;
5 our $VERSION = '1.302062';
8 use Test2::Util qw/pkg_to_file/;
15 BEGIN { require Exporter; our @ISA = qw(Exporter) }
17 sub upgrade_suggested {
19 'Test::Exception' => '0.42',
20 'Test::FITesque' => '0.04',
21 'Test::Module::Used' => '0.2.5',
22 'Test::Moose::More' => '0.025',
26 sub upgrade_required {
28 'Test::Builder::Clutch' => '0.07',
29 'Test::Dist::VersionSync' => '1.1.4',
30 'Test::Modern' => '0.012',
31 'Test::SharedFork' => '0.34',
32 'Test::Alien' => '0.04',
33 'Test::UseAllModules' => '0.14',
35 'Test::Clustericious::Cluster' => '0.30',
41 'Net::BitTorrent' => '0.052',
42 'Test::Able' => '0.11',
43 'Test::Aggregate' => '0.373',
44 'Test::Flatten' => '0.11',
45 'Test::Group' => '0.20',
46 'Test::More::Prefix' => '0.005',
47 'Test::ParallelSubtest' => '0.05',
48 'Test::Pretty' => '0.32',
49 'Test::Wrapper' => '0.3.0',
51 'Test::DBIx::Class::Schema' => '1.0.9',
52 'Log::Dispatch::Config::TestLog' => '0.02',
57 # Device::Chip => 0.07 - Tests will not pass, but not broken if already installed, also no fixed version we can upgrade to.
63 my %suggest = __PACKAGE__->upgrade_suggested();
64 my %required = __PACKAGE__->upgrade_required();
65 my %broken = __PACKAGE__->known_broken();
68 for my $mod (keys %suggest) {
69 my $file = pkg_to_file($mod);
70 next unless $INC{$file} || ($require && eval { require $file; 1 });
71 my $want = $suggest{$mod};
72 next if eval { $mod->VERSION($want); 1 };
73 push @warn => " * Module '$mod' is outdated, we recommed updating above $want.";
76 for my $mod (keys %required) {
77 my $file = pkg_to_file($mod);
78 next unless $INC{$file} || ($require && eval { require $file; 1 });
79 my $want = $required{$mod};
80 next if eval { $mod->VERSION($want); 1 };
81 push @warn => " * Module '$mod' is outdated and known to be broken, please update to $want or higher.";
84 for my $mod (keys %broken) {
85 my $file = pkg_to_file($mod);
86 next unless $INC{$file} || ($require && eval { require $file; 1 });
87 my $tested = $broken{$mod};
88 push @warn => " * Module '$mod' is known to be broken in version $tested and below, newer versions have not been tested. You have: " . $mod->VERSION;
105 Test2::API::Breakage - What breaks at what version
109 This module provides lists of modules that are broken, or have been broken in
110 the past, when upgrading L<Test::Builder> to use L<Test2>.
114 These can be imported, or called as methods on the class.
118 =item %mod_ver = upgrade_suggested()
120 =item %mod_ver = Test2::API::Breakage->upgrade_suggested()
122 This returns key/value pairs. The key is the module name, the value is the
123 version number. If the installed version of the module is at or below the
124 specified one then an upgrade would be a good idea, but not strictly necessary.
126 =item %mod_ver = upgrade_required()
128 =item %mod_ver = Test2::API::Breakage->upgrade_required()
130 This returns key/value pairs. The key is the module name, the value is the
131 version number. If the installed version of the module is at or below the
132 specified one then an upgrade is required for the module to work properly.
134 =item %mod_ver = known_broken()
136 =item %mod_ver = Test2::API::Breakage->known_broken()
138 This returns key/value pairs. The key is the module name, the value is the
139 version number. If the installed version of the module is at or below the
140 specified one then the module will not work. A newer version may work, but is
141 not tested or verified.
147 The source code repository for Test2 can be found at
148 F<http://github.com/Test-More/test-more/>.
154 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
162 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
168 Copyright 2016 Chad Granum E<lt>exodist@cpan.orgE<gt>.
170 This program is free software; you can redistribute it and/or
171 modify it under the same terms as Perl itself.
173 See F<http://dev.perl.org/licenses/>