Add ExtUtils::Miniperl to the list of core modules for all versions >= 5.00504
[p5sagit/p5-mst-13.2.git] / lib / Module / Build / t / use_tap_harness.t
CommitLineData
d1ef72e8 1#!/usr/bin/perl -w
2
3use strict;
4use Test::More;
5use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib';
6if (eval { require TAP::Parser }) {
7 plan tests => 8;
8} else {
9 plan skip_all => 'TAP::Parser not installed'
10}
11
12use MBTest;
13use DistGen;
14
15use_ok 'Module::Build';
16ensure_blib('Module::Build');
17my $tmp = MBTest->tmpdir;
18my $dist = DistGen->new( dir => $tmp );
19$dist->regen;
20
21$dist->chdir_in;
22#########################
23
24# Make sure that TAP::Harness properly does its thing.
25ok my $mb = Module::Build->new(
26 module_name => $dist->name,
27 use_tap_harness => 1,
28 quiet => 1,
29), 'Construct build object with test_file_exts parameter';
30
31$mb->add_to_cleanup('save_out');
32# Use uc() so we don't confuse the current test output
33my $out = uc(stdout_of(
34 sub {$mb->dispatch('test', verbose => 1)}
35));
36
37like $out, qr/^OK 1/m, 'Should see first test output';
38like $out, qr/^ALL TESTS SUCCESSFUL/m, 'Should see test success message';
39
40#########################
41
42# Make sure that arguments are passed through to TAP::Harness.
43ok $mb = Module::Build->new(
44 module_name => $dist->name,
45 use_tap_harness => 1,
46 tap_harness_args => { verbosity => 0 },
47 quiet => 1,
48), 'Construct build object with test_file_exts parameter';
49
50$mb->add_to_cleanup('save_out');
51# Use uc() so we don't confuse the current test output
52$out = uc(stdout_of(
53 sub {$mb->dispatch('test', verbose => 1)}
54));
55
56unlike $out, qr/^OK 1/m, 'Should not see first test output';
57like $out, qr/^ALL TESTS SUCCESSFUL/m, 'Should see test success message';
58
59$dist->remove;
60
61# vim:ts=4:sw=4:et:sta