X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faccessors_xs.t;h=fdd251ea645be6c4ba5e5e5c062834759e78ca38;hb=cfed50f29bcf6d80bb6e72146c5a051a3f36f656;hp=258e273c1296b25da4709bb564c0258e08105229;hpb=2834410402128f3ade69b3c35bf9fbdebf81d172;p=p5sagit%2FClass-Accessor-Grouped.git diff --git a/t/accessors_xs.t b/t/accessors_xs.t index 258e273..fdd251e 100644 --- a/t/accessors_xs.t +++ b/t/accessors_xs.t @@ -2,6 +2,7 @@ use strict; use warnings; use FindBin qw($Bin); use File::Spec::Functions; +use File::Spec::Unix (); # need this for %INC munging use Test::More; use lib 't/lib'; @@ -18,8 +19,21 @@ BEGIN { # rerun the regular 3 tests under XSAccessor $Class::Accessor::Grouped::USE_XS = 1; -for (qw/accessors.t accessors_ro.t accessors_wo.t/) { - subtest "$_ with USE_XS" => sub { require( catfile($Bin, $_) ) } +for my $tname (qw/accessors.t accessors_ro.t accessors_wo.t/) { + + subtest "$tname with USE_XS (pass $_)" => sub { + my $tfn = catfile($Bin, $tname); + + delete $INC{$_} for ( + qw/AccessorGroups.pm AccessorGroupsRO.pm AccessorGroupsSubclass.pm AccessorGroupsWO.pm/, + File::Spec::Unix->catfile ($tfn), + ); + + local $SIG{__WARN__} = sub { warn @_ unless $_[0] =~ /subroutine .+ redefined/i }; + + do($tfn); + + } for (1 .. 2); } done_testing;