5 use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib';
6 if (eval { require TAP::Parser }) {
9 plan skip_all => 'TAP::Parser not installed'
15 use_ok 'Module::Build';
16 ensure_blib('Module::Build');
17 my $tmp = MBTest->tmpdir;
18 my $dist = DistGen->new( dir => $tmp );
22 #########################
24 # Make sure that TAP::Harness properly does its thing.
25 ok my $mb = Module::Build->new(
26 module_name => $dist->name,
29 ), 'Construct build object with test_file_exts parameter';
31 $mb->add_to_cleanup('save_out');
32 # Use uc() so we don't confuse the current test output
33 my $out = uc(stdout_of(
34 sub {$mb->dispatch('test', verbose => 1)}
37 like $out, qr/^OK 1/m, 'Should see first test output';
38 like $out, qr/^ALL TESTS SUCCESSFUL/m, 'Should see test success message';
40 #########################
42 # Make sure that arguments are passed through to TAP::Harness.
43 ok $mb = Module::Build->new(
44 module_name => $dist->name,
46 tap_harness_args => { verbosity => 0 },
48 ), 'Construct build object with test_file_exts parameter';
50 $mb->add_to_cleanup('save_out');
51 # Use uc() so we don't confuse the current test output
53 sub {$mb->dispatch('test', verbose => 1)}
56 unlike $out, qr/^OK 1/m, 'Should not see first test output';
57 like $out, qr/^ALL TESTS SUCCESSFUL/m, 'Should see test success message';
61 # vim:ts=4:sw=4:et:sta