| 1 |
# Note: this file was auto-generated by Module::Build::Compat version 0.03 |
| 2 |
use ExtUtils::MakeMaker; |
| 3 |
WriteMakefile |
| 4 |
( |
| 5 |
'PL_FILES' => {}, |
| 6 |
'INSTALLDIRS' => 'site', |
| 7 |
'NAME' => 'Bogus::Module', |
| 8 |
'EXE_FILES' => [], |
| 9 |
'VERSION_FROM' => 'lib/Bogus/Module.pm', |
| 10 |
'PREREQ_PM' => {}, |
| 11 |
) |
| 12 |
; |
| 13 |
|
| 14 |
package MY; |
| 15 |
require File::Spec; |
| 16 |
# copied from ExtUtils::MM_Unix, but test.pl is replaced with test/Tester.pl |
| 17 |
sub test { |
| 18 |
# --- Test and Installation Sections --- |
| 19 |
|
| 20 |
my $test_pl = File::Spec->catfile(qw/test Tester.pl/); |
| 21 |
my($self, %attribs) = @_; |
| 22 |
my $tests = $attribs{TESTS} || ''; |
| 23 |
if (!$tests && -d 't') { |
| 24 |
$tests = $self->find_tests; |
| 25 |
} |
| 26 |
# note: 'test.pl' name is also hardcoded in init_dirscan() |
| 27 |
my(@m); |
| 28 |
push(@m," |
| 29 |
TEST_VERBOSE=0 |
| 30 |
TEST_TYPE=test_\$(LINKTYPE) |
| 31 |
TEST_FILE = $test_pl |
| 32 |
TEST_FILES = $tests |
| 33 |
TESTDB_SW = -d |
| 34 |
|
| 35 |
testdb :: testdb_\$(LINKTYPE) |
| 36 |
|
| 37 |
test :: \$(TEST_TYPE) subdirs-test |
| 38 |
|
| 39 |
subdirs-test :: |
| 40 |
\$(NOECHO) \$(NOOP) |
| 41 |
|
| 42 |
"); |
| 43 |
|
| 44 |
foreach my $dir (@{ $self->{DIR} }) { |
| 45 |
my $test = $self->cd($dir, '$(MAKE) test $(PASTHRU)'); |
| 46 |
|
| 47 |
push @m, <<END |
| 48 |
subdirs-test :: |
| 49 |
\$(NOECHO) $test |
| 50 |
|
| 51 |
END |
| 52 |
} |
| 53 |
|
| 54 |
push(@m, "\t\$(NOECHO) \$(ECHO) 'No tests defined for \$(NAME) extension.'\n") |
| 55 |
unless $tests or -f $test_pl or @{$self->{DIR}}; |
| 56 |
push(@m, "\n"); |
| 57 |
|
| 58 |
push(@m, "test_dynamic :: pure_all\n"); |
| 59 |
push(@m, $self->test_via_harness('$(FULLPERLRUN)', '$(TEST_FILES)')) |
| 60 |
if $tests; |
| 61 |
push(@m, $self->test_via_script('$(FULLPERLRUN)', '$(TEST_FILE)')) |
| 62 |
if -f $test_pl; |
| 63 |
push(@m, "\n"); |
| 64 |
|
| 65 |
push(@m, "testdb_dynamic :: pure_all\n"); |
| 66 |
push(@m, $self->test_via_script('$(FULLPERLRUN) $(TESTDB_SW)', |
| 67 |
'$(TEST_FILE)')); |
| 68 |
push(@m, "\n"); |
| 69 |
|
| 70 |
# Occasionally we may face this degenerate target: |
| 71 |
push @m, "test_ : test_dynamic\n\n"; |
| 72 |
|
| 73 |
if ($self->needs_linking()) { |
| 74 |
push(@m, "test_static :: pure_all \$(MAP_TARGET)\n"); |
| 75 |
push(@m, $self->test_via_harness('./$(MAP_TARGET)', '$(TEST_FILES)')) if $tests; |
| 76 |
push(@m, $self->test_via_script('./$(MAP_TARGET)', '$(TEST_FILE)')) if -f $test_pl; |
| 77 |
push(@m, "\n"); |
| 78 |
push(@m, "testdb_static :: pure_all \$(MAP_TARGET)\n"); |
| 79 |
push(@m, $self->test_via_script('./$(MAP_TARGET) $(TESTDB_SW)', '$(TEST_FILE)')); |
| 80 |
push(@m, "\n"); |
| 81 |
} else { |
| 82 |
push @m, "test_static :: test_dynamic\n"; |
| 83 |
push @m, "testdb_static :: testdb_dynamic\n"; |
| 84 |
} |
| 85 |
join("", @m); |
| 86 |
} |