From: Karen Etheridge Date: Wed, 1 Aug 2012 21:19:31 +0000 (-0700) Subject: RT#78724: --to-stderr was broken X-Git-Tag: v0.009009~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=020d9b767a668331a424cb7282bbff0513fb7f4f;p=p5sagit%2FApp-FatPacker.git RT#78724: --to-stderr was broken --- diff --git a/Changes b/Changes index 79d1d0d..733680b 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + - RT #78724: fix trace --to-stderr (ether) + 0.9.8 2012-07-16 - RT #78391: Avoid using $_ when requiring modules diff --git a/lib/App/FatPacker.pm b/lib/App/FatPacker.pm index b643d3a..b2d22f4 100644 --- a/lib/App/FatPacker.pm +++ b/lib/App/FatPacker.pm @@ -84,7 +84,7 @@ sub script_command_trace { } my $arg = do { if ($to_stderr) { - "=&STDERR" + ">&STDERR" } elsif ($file) { ">>${file}" } diff --git a/t/trace.t b/t/trace.t index 8ed24aa..ab3a490 100644 --- a/t/trace.t +++ b/t/trace.t @@ -27,3 +27,24 @@ sub test_trace { unlink "fatpacker.trace"; } +test_trace("t/mod/a.pm" => ("t/mod/b.pm", "t/mod/c.pm")); + +sub test_trace_stderr { + my($file, @loaded) = @_; + local $Test::Builder::Level = $Test::Builder::Level + 1; + + system(join(' ', + $^X, "-Mblib", "-MApp::FatPacker::Trace", '--to-stderr', $file, + '>', 'fatpacker.trace', '2>&1')); + + open my $trace, "<", "fatpacker.trace"; + while(<$trace>) { + chomp; + my $load = $_; + @loaded = grep { $load ne $_ } @loaded; + } + + ok !@loaded, "All expected modules loaded for $file"; + unlink "fatpacker.trace"; +} +