remove non-working stderr trace test
[p5sagit/App-FatPacker.git] / t / trace.t
1 use strict;
2 use warnings FATAL => 'all';
3 use Test::More qw(no_plan);
4
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"));
9
10 # Attempts to conditionally load a module that isn't present
11 test_trace("t/mod/cond.pm" => ());
12
13 sub test_trace {
14   my($file, @loaded) = @_;
15   local $Test::Builder::Level = $Test::Builder::Level + 1;
16
17   unlink "fatpacker.trace";
18   system($^X, "-Mblib", "-MApp::FatPacker::Trace", $file);
19
20   open my $trace, "<", "fatpacker.trace";
21   my @traced = sort map { chomp; $_ } <$trace>;
22   close $trace;
23
24   is_deeply \@traced, \@loaded, "All expected modules loaded for $file";
25   unlink "fatpacker.trace";
26 }