X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fsbin%2Frt-test-dependencies.in;h=d41337a961294ad9799fe9d12aae8715e51ca8c7;hb=c71b2dc296da6207c525a064d322f7153c284d4e;hp=8681054313065e7f9301ed6524b2ae4860d8b58c;hpb=45d35d5739d05e602bc317739485693e0e9ff0b5;p=freeside.git diff --git a/rt/sbin/rt-test-dependencies.in b/rt/sbin/rt-test-dependencies.in index 868105431..d41337a96 100644 --- a/rt/sbin/rt-test-dependencies.in +++ b/rt/sbin/rt-test-dependencies.in @@ -55,9 +55,13 @@ use strict; use warnings; no warnings qw(numeric redefine); use Getopt::Long; +use Cwd qw(abs_path); my %args; my %deps; my @orig_argv = @ARGV; +# Save our path because installers or tests can change cwd +my $script_path = abs_path($0); + GetOptions( \%args, 'v|verbose', 'install!', 'with-MYSQL', @@ -177,6 +181,12 @@ sub text_to_hash { return %hash; } +sub set_dep { + my ($name, $module, $version) = @_; + my %list = @{$deps{$name}}; + $list{$module} = ($version || ''); + $deps{$name} = [ %list ]; +} $deps{'CORE'} = [ text_to_hash( << '.') ]; Class::Accessor 0.34 @@ -249,6 +259,8 @@ Plack 0.9971 Plack::Handler::Starlet CGI::Emulate::PSGI . +set_dep( PSGI => CGI => 4.00 ) if $] > 5.019003; + $deps{'MAILGATE'} = [ text_to_hash( << '.') ]; Getopt::Long @@ -292,7 +304,7 @@ Test::Builder 0.90 # needed for is_passing Test::MockTime Log::Dispatch::Perl Test::WWW::Mechanize::PSGI -Plack::Middleware::Test::StashWarnings 0.06 +Plack::Middleware::Test::StashWarnings 0.08 Test::LongString Test::NoWarnings Locale::PO @@ -370,6 +382,7 @@ HTML::Entities my %AVOID = ( 'DBD::Oracle' => [qw(1.23)], + 'DBD::Pg' => [qw(3.3.0)], 'Email::Address' => [qw(1.893 1.894)], 'Devel::StackTrace' => [qw(1.28 1.29)], ); @@ -417,7 +430,7 @@ foreach my $type (sort grep $args{$_}, keys %args) { } if ( $args{'install'} && keys %Missing_By_Type ) { - exec($0, @orig_argv, '--no-install'); + exec($script_path, @orig_argv, '--no-install'); } else { conclude(%Missing_By_Type); @@ -449,6 +462,7 @@ sub test_dep { print $module, ': ', $version || 0, "\n"; } else { + no warnings 'deprecated'; eval "use $module $version ()"; if ( my $error = $@ ) { return 0 unless wantarray;