peters has asked for the wisdom of the Perl Monks concerning the following question:
First is to tie STDOUT and STDERR and grab the output that way. I haven't tried that yet because I experimented instead with redefining Test::Builder::_print() as follows via a module that would replace Test::More in my friend's test. Any suggestions for the best approach to take?
package Testicle; use Test::Builder::Module; require Test::More; our @ISA = qw(Test::More); use base 'Exporter'; our @EXPORT = @Test::More::EXPORT; Test::More->import; my $builder; BEGIN { $builder = Test::Builder::Module->builder; my $class = ref $builder; no strict 'refs'; no warnings 'redefine'; *{ "${class}::_print" } = sub { shift; "Have my way with @_" }; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Intercepting TAP output
by kyle (Abbot) on May 08, 2008 at 03:53 UTC | |
|
Re: Intercepting TAP output
by tachyon-II (Chaplain) on May 08, 2008 at 04:15 UTC | |
by reisinge (Hermit) on Jul 05, 2013 at 21:11 UTC | |
by peters (Sexton) on May 08, 2008 at 17:46 UTC | |
by peters (Sexton) on May 09, 2008 at 00:47 UTC | |
by Anonymous Monk on May 08, 2008 at 13:17 UTC | |
|
Re: Intercepting TAP output
by hesco (Deacon) on May 08, 2008 at 05:50 UTC |