3 # Ensure pm_to_blib runs at the right times.
8 use Test::More 'no_plan';
10 use ExtUtils::MakeMaker;
12 use MakeMaker::Test::Utils;
13 use MakeMaker::Test::Setup::BFD;
16 my $perl = which_perl();
17 my $makefile = makefile_name();
18 my $make = make_run();
21 # Setup our test environment
27 ok( setup_recurs(), 'setup' );
29 ok( chdir File::Spec->updir );
30 ok( teardown_recurs(), 'teardown' );
33 ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) ||
34 diag("chdir failed: $!");
40 run_ok(qq{$perl Makefile.PL});
43 ok( -e "blib/lib/Big/Dummy.pm", "blib copied pm file" );
47 # Change a pm file, it should be copied.
49 # Wait a couple seconds else our changed file will have the same timestamp
53 ok( open my $fh, ">>", "lib/Big/Dummy.pm" ) or die $!;
54 print $fh "Something else\n";
58 like slurp("blib/lib/Big/Dummy.pm"), qr/Something else\n$/;
62 # Rerun the Makefile.PL, pm_to_blib should rerun
64 run_ok(qq{$perl Makefile.PL});
66 # XXX This is a fragile way to check that it reran.
67 like run_ok($make), qr/^Skip /ms;
69 ok( -e "blib/lib/Big/Dummy.pm", "blib copied pm file" );