From: Peter Rabbitson Date: Sun, 24 Apr 2016 13:49:30 +0000 (+0200) Subject: Fix last remaining tests with -T under < 5.10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=652d9b762;p=dbsrgits%2FDBIx-Class.git Fix last remaining tests with -T under < 5.10 Model on https://github.com/p5sagit/namespace-clean/commit/acb1d694, this is still a mega-kludge, as the FIXME in the file says --- diff --git a/maint/travis-ci_scripts/40_script.bash b/maint/travis-ci_scripts/40_script.bash index 25a35ff..0a6ecd5 100755 --- a/maint/travis-ci_scripts/40_script.bash +++ b/maint/travis-ci_scripts/40_script.bash @@ -28,12 +28,7 @@ if [[ "$CLEANTEST" = "true" ]] ; then run_or_err "Prepare blib" "make pure_all" run_harness_tests else - PROVECMD="prove -lrswj$VCPU_USE xt t" - - # FIXME - temporary, until Package::Stash is fixed - if perl -M5.010 -e 1 &>/dev/null ; then - PROVECMD="$PROVECMD -T" - fi + PROVECMD="prove -lrswTj$VCPU_USE xt t" # List every single SKIP/TODO when they are visible if [[ "$VCPU_USE" == 1 ]] ; then diff --git a/t/94versioning.t b/t/94versioning.t index 117f02a..af46ef7 100644 --- a/t/94versioning.t +++ b/t/94versioning.t @@ -24,6 +24,11 @@ my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MYSQL_${_}" } qw/DSN USER PASS/}; # in case it came from the env $ENV{DBIC_NO_VERSION_CHECK} = 0; +# FIXME - work around RT#113965 in combination with -T on older perls: +# the non-deparsing XS portion of D::D gets confused by some of the IO +# handles trapped in the debug object of DBIC. What a mess. +$Data::Dumper::Deparse = 1; + use_ok('DBICVersion_v1'); my $version_table_name = 'dbix_class_schema_versions'; diff --git a/xt/extra/internals/namespaces_cleaned.t b/xt/extra/internals/namespaces_cleaned.t index 01650d5..36e12b1 100644 --- a/xt/extra/internals/namespaces_cleaned.t +++ b/xt/extra/internals/namespaces_cleaned.t @@ -35,13 +35,35 @@ BEGIN { use strict; use warnings; +# FIXME This is a crock of shit, needs to go away +# currently here to work around https://rt.cpan.org/Ticket/Display.html?id=74151 +# kill with fire when PS::XS / RT#74151 is *finally* fixed +BEGIN { + my $PS_provider; + + if ( "$]" < 5.010 ) { + require Package::Stash::PP; + $PS_provider = 'Package::Stash::PP'; + } + else { + require Package::Stash; + $PS_provider = 'Package::Stash'; + } + eval <<"EOS" or die $@; + +sub stash_for (\$) { + $PS_provider->new(\$_[0]); +} +1; +EOS +} + use Test::More; use DBICTest; use File::Find; use File::Spec; use B qw/svref_2object/; -use Package::Stash; # makes sure we can load at least something use DBIx::Class; @@ -96,7 +118,7 @@ for my $mod (@modules) { skip "$mod exempt from namespace checks",1 if $skip_idx->{$mod}; my %all_method_like = (map - { %{Package::Stash->new($_)->get_all_symbols('CODE')} } + { %{stash_for($_)->get_all_symbols('CODE')} } (reverse @{mro::get_linear_isa($mod)}) );