Add ExtUtils::Miniperl to the list of core modules for all versions >= 5.00504
[p5sagit/p5-mst-13.2.git] / lib / Module / Build / t / test_file_exts.t
CommitLineData
d1ef72e8 1#!/usr/bin/perl -w
2
3use strict;
4use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib';
5use MBTest tests => 5;
6use DistGen;
7
8use_ok 'Module::Build';
9ensure_blib('Module::Build');
10
11my $tmp = MBTest->tmpdir;
12my $dist = DistGen->new( dir => $tmp );
13
14$dist->add_file('t/mytest.s', <<'---' );
15#!perl
16use Test::More tests => 2;
17ok(1, 'first mytest.s');
18ok(1, 'second mytest.s');
19---
20
21$dist->regen;
22$dist->chdir_in;
23
24#########################
25
26# So make sure that the test gets run with the alternate extension.
27ok my $mb = Module::Build->new(
28 module_name => $dist->name,
29 test_file_exts => ['.s'],
30 quiet => 1,
31), 'Construct build object with test_file_exts parameter';
32
33$mb->add_to_cleanup('save_out');
34# Use uc() so we don't confuse the current test output
35my $out = uc(stdout_of(
36 sub {$mb->dispatch('test', verbose => 1)}
37));
38
39like $out, qr/^OK 1 - FIRST MYTEST[.]S/m, 'Should see first test output';
40like $out, qr/^OK 2 - SECOND MYTEST[.]S/m, 'Should see second test output';
41
42# Cleanup.
43$dist->remove;
44
45# vim:ts=4:sw=4:et:sta