2 use warnings FATAL => 'all';
3 use Test::More qw(no_plan);
5 test_trace("t/mod/ModuleA.pm" => ("ModuleB.pm", "ModuleC.pm"));
6 test_trace("t/mod/ModuleB.pm" => ("ModuleC.pm"));
7 test_trace("t/mod/ModuleC.pm" => ());
8 test_trace("t/mod/ModuleD.pl" => ("ModuleD.pm"));
10 # Attempts to conditionally load a module that isn't present
11 test_trace("t/mod/ModuleCond.pm" => ());
14 my($file, @loaded) = @_;
15 local $Test::Builder::Level = $Test::Builder::Level + 1;
17 unlink "fatpacker.trace";
18 system($^X, "-Mblib", '-It/mod', "-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";