/^--xs/ and $force_xs = 1;
}
-my $has_compiler = $force_xs;
+our $has_compiler = $force_xs;
unless ( defined $force_xs ) {
$has_compiler = check_for_compiler()
or no_cc();
'File::Spec' => '0',
'Carp' => '0',
'Devel::GlobalDestruction' => '0',
+ 'Task::Weaken' => '0',
+ 'B' => '0',
);
delete @prereqs{qw(Sub::Name Devel::GlobalDestruction)}
PREREQ_PM => \%prereqs,
CONFIGURE => \&init,
CCFLAGS => $ccflags,
- clean => { FILES => 'test.c test.o' },
+ clean => { FILES => 'test.c test.o t/pp*' },
ABSTRACT_FROM => 'lib/Class/MOP.pm',
AUTHOR => 'Stevan Little <stevan@iinteractive.com>',
LICENSE => 'perl',
return 1;
}
+# This sucks, but it's the best guess we can make. Since we just use
+# it to run two sets of tests, it's not big deal if it ends up true
+# for a non-maintainer.
+sub is_maintainer {
+ return 0 if $ENV{PERL5_CPAN_IS_RUNNING} || $ENV{PERL5_CPANPLUS_IS_RUNNING};
+
+ return 1;
+}
+
+sub get_pp_tests {
+ opendir my $dh, 't' or die "Cannot read t: $!";
+
+ return map {
+ File::Spec->catfile('t', "pp_${_}")
+ } grep { $_ !~ /^99/ } grep {/^\d.+\.t$/} readdir $dh;
+}
+
# This is EUMM voodoo
sub init {
my $hash = $_[1];
$hash;
}
+
+package MY;
+
+sub postamble {
+ my $pp_tests = join q{ }, ::get_pp_tests();
+ my $test_dep = $::has_compiler && ::is_maintainer()
+ ? 'pure_all :: pp_tests'
+ : '';
+
+ return <<"EOM"
+pp_tests: ${pp_tests}
+
+${test_dep}
+
+t/pp_%: t/% t/header_pp.inc
+\t\$(NOECHO) \$(ABSPERLRUN) "-MExtUtils::Command" -e cat t/header_pp.inc \$< > \$@
+EOM
+}