X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fsbin%2Frt-test-dependencies.in;h=ff987283bcdb543ea2f174185d48f93b3eafc865;hb=30026a09a72bb16b8c7e17035250b9d797bd47e2;hp=df1ef135f1c9daa702715c0a50dabd961a284a13;hpb=679854b8bbc65d112071111bbd7f34a6a481fb30;p=freeside.git diff --git a/rt/sbin/rt-test-dependencies.in b/rt/sbin/rt-test-dependencies.in index df1ef135f..ff987283b 100644 --- a/rt/sbin/rt-test-dependencies.in +++ b/rt/sbin/rt-test-dependencies.in @@ -3,7 +3,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -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 @@ -261,7 +273,6 @@ Crypt::SSLeay Net::SSL LWP::UserAgent 6.0 LWP::Protocol::https -Mozilla::CA . $deps{'CLI'} = [ text_to_hash( << '.') ]; @@ -292,9 +303,10 @@ 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 . $deps{'FASTCGI'} = [ text_to_hash( << '.') ]; @@ -321,6 +333,7 @@ DBD::Oracle . $deps{'POSTGRESQL'} = [ text_to_hash( << '.') ]; +DBIx::SearchBuilder 1.66 DBD::Pg 1.43 . @@ -416,7 +429,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); @@ -448,6 +461,7 @@ sub test_dep { print $module, ': ', $version || 0, "\n"; } else { + no warnings 'deprecated'; eval "use $module $version ()"; if ( my $error = $@ ) { return 0 unless wantarray;