1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
use strict;
use warnings;
use Test::More 0.96;
use if $ENV{AUTHOR_TESTING}, 'Test::Warnings';
use Test::Fatal;
use Test::DZil;
use Test::Deep;
use Path::Tiny 0.062;
my $tzil = Builder->from_config(
{ dist_root => 'does-not-exist' },
{
add_files => {
path(qw(source dist.ini)) => simple_ini(
'GatherDir',
[ 'MakeMaker::Fallback' ],
[ 'ModuleBuildTiny' ],
),
path(qw(source share foo)) => 'this is some sharedir content',
},
},
);
$tzil->chrome->logger->set_debug(1);
is(
exception { $tzil->build },
undef,
'build proceeds normally',
);
cmp_deeply(
$tzil->log_messages,
superbagof(
re(qr{\Q[MakeMaker::Fallback] share/ files present: did you forget to include [ShareDir]?\E}),
),
'warning is presented if [ShareDir] might have been forgotten',
);
diag 'got log messages: ', explain $tzil->log_messages
if not Test::Builder->new->is_passing;
done_testing;
|