2 use warnings FATAL => 'all';
3 use Test::More qw(no_plan);
5 test_trace("t/mod/a.pm" => ("t/mod/b.pm", "t/mod/c.pm"));
6 test_trace("t/mod/b.pm" => ("t/mod/c.pm"));
7 test_trace("t/mod/c.pm" => ());
8 test_trace("t/mod/d.pl" => ("t/mod/d.pm"));
10 # Attempts to conditionally load a module that isn't present
11 test_trace("t/mod/cond.pm" => ());
14 my($file, @loaded) = @_;
15 local $Test::Builder::Level = $Test::Builder::Level + 1;
17 unlink "fatpacker.trace";
18 system($^X, "-Mblib", "-MApp::FatPacker::Trace", $file);
20 open my $trace, "<", "fatpacker.trace";
21 my @traced = sort map { chomp; $_ } <$trace>;
24 is_deeply \@traced, \@loaded, "All expected modules loaded for $file";
25 unlink "fatpacker.trace";