3 # Ensure pm_to_blib runs at the right times.
15 use Test::More 'no_plan';
17 use ExtUtils::MakeMaker;
19 use MakeMaker::Test::Utils;
20 use MakeMaker::Test::Setup::BFD;
23 my $perl = which_perl();
24 my $makefile = makefile_name();
25 my $make = make_run();
28 # Setup our test environment
34 ok( setup_recurs(), 'setup' );
36 ok( chdir File::Spec->updir );
37 ok( teardown_recurs(), 'teardown' );
40 ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) ||
41 diag("chdir failed: $!");
47 run_ok(qq{$perl Makefile.PL});
50 ok( -e "blib/lib/Big/Dummy.pm", "blib copied pm file" );
54 # Change a pm file, it should be copied.
56 # Wait a couple seconds else our changed file will have the same timestamp
60 ok( open my $fh, ">>", "lib/Big/Dummy.pm" ) or die $!;
61 print $fh "Something else\n";
65 like slurp("blib/lib/Big/Dummy.pm"), qr/Something else\n$/;
69 # Rerun the Makefile.PL, pm_to_blib should rerun
71 run_ok(qq{$perl Makefile.PL});
73 # XXX This is a fragile way to check that it reran.
74 like run_ok($make), qr/^Skip /ms;
76 ok( -e "blib/lib/Big/Dummy.pm", "blib copied pm file" );