if $] > '5.008'; # CXSA does not work on 5.6
}
-test_requires 'Test::More' => '0.94';
+test_requires 'Test::More' => '0.88';
test_requires 'Test::Exception' => '0.31';
clean_files "Class-Accessor-Grouped-* t/var";
use Test::More;
use strict;
use warnings;
+no warnings 'once';
use lib 't/lib';
use B qw/svref_2object/;
}
}
-done_testing;
+done_testing unless $::SUBTESTING;
require Class::Accessor::Grouped;
}
+
# rerun the regular 3 tests under the assumption of no Sub::Name
-for my $tname (qw/accessors.t accessors_ro.t accessors_wo.t clean_namespace.t/) {
+our $SUBTESTING = 1;
+for my $tname (qw/accessors.t accessors_ro.t accessors_wo.t/) {
+
+ for (1,2) {
+ note "\nTesting $tname without Sub::Name (pass $_)\n\n";
- subtest "$tname without Sub::Name (pass $_)" => sub {
my $tfn = catfile($Bin, $tname);
delete $INC{$_} for (
do($tfn);
- } for (1 .. 2);
+ }
}
done_testing;
-use Test::More tests => 58;
+use Test::More;
use Test::Exception;
use strict;
use warnings;
+no warnings 'once';
use Config;
use lib 't/lib';
is($obj->$alias, 'a');
};
-#important
-1;
+done_testing unless $::SUBTESTING;
-use Test::More tests => 46;
+use Test::More;
use Test::Exception;
use strict;
use warnings;
+no warnings 'once';
use Config;
use lib 't/lib';
}
};
-# important
-1;
\ No newline at end of file
+done_testing unless $::SUBTESTING;
}
# rerun the regular 3 tests under XSAccessor
+our $SUBTESTING = 1;
$Class::Accessor::Grouped::USE_XS = 1;
-for my $tname (qw/accessors.t accessors_ro.t accessors_wo.t clean_namespace.t/) {
- subtest "$tname with USE_XS (pass $_)" => sub {
+for my $tname (qw/accessors.t accessors_ro.t accessors_wo.t/) {
+
+ for (1,2) {
+ note "\nTesting $tname with USE_XS (pass $_)\n\n";
+
my $tfn = catfile($Bin, $tname);
for (
local $SIG{__WARN__} = sub { warn @_ unless $_[0] =~ /subroutine .+ redefined/i };
do($tfn);
-
- } for (1 .. 2);
+ }
}
done_testing;
-use Test::More tests => 4;
+use Test::More;
use Test::Exception;
use strict;
use warnings;
is($warned, 3, 'Correct amount of unise warnings');
}
-{
+if (eval { require Sub::Name } ) {
my $warned = 0;
local $SIG{__WARN__} = sub {
$_[0] =~ /Installing illegal accessor/ ? $warned++ : warn(@_)
local $ENV{CAG_ILLEGAL_ACCESSOR_NAME_OK} = 1;
AccessorGroupsSubclass->mk_group_accessors(simple => "2wr\0vwrv;")
} qr/nulls should never appear/;
-1;
+
+done_testing;