Commit | Line | Data |
d1ef72e8 |
1 | #!/usr/bin/perl -w |
2 | |
3 | use strict; |
4 | use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib'; |
5 | use MBTest tests => 5; |
6 | use DistGen; |
7 | |
8 | use_ok 'Module::Build'; |
9 | ensure_blib('Module::Build'); |
10 | |
11 | my $tmp = MBTest->tmpdir; |
12 | my $dist = DistGen->new( dir => $tmp ); |
13 | |
14 | $dist->add_file('t/mytest.s', <<'---' ); |
15 | #!perl |
16 | use Test::More tests => 2; |
17 | ok(1, 'first mytest.s'); |
18 | ok(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. |
27 | ok 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 |
35 | my $out = uc(stdout_of( |
36 | sub {$mb->dispatch('test', verbose => 1)} |
37 | )); |
38 | |
39 | like $out, qr/^OK 1 - FIRST MYTEST[.]S/m, 'Should see first test output'; |
40 | like $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 |