Test::Run::CmdLine::Trap::ProveApp - trap the output of a run of


Test-Run-CmdLine documentation Contained in the Test-Run-CmdLine distribution.

Index


Code Index:

NAME

Top

Test::Run::CmdLine::Trap::ProveApp - trap the output of a run of Test::Run::CmdLine::Prove::App.

DESCRIPTION

Top

Testing class to trap the output of a perl -MTest::Run::CmdLine::Prove::App ... run.

METHODS

Top

Test::Run::CmdLine::Trap::Prove->trap_run({cmdline => [@ARGS]})

Traps the output of the application with the command line args of @ARGS. Returns the object. To be used as a constructor.

AUTHORS

Top

Shlomi Fish, <shlomif@iglu.org.il>

BUGS

Top

Please report any bugs or feature requests to bug-test-run-cmdline@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Run-CmdLine. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Test::Run::CmdLine::Trap::ProveApp

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Test::Run::CmdLine

* CPAN Ratings

http://cpanratings.perl.org/d/Test::Run::CmdLine

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test::Run::CmdLine

* Search CPAN

http://search.cpan.org/dist/Test::Run::CmdLine/

SOURCE AVAILABILITY

Top

The latest source of Test::Run::CmdLine is available from the Test::Run BerliOS Subversion repository:

https://svn.berlios.de/svnroot/repos/web-cpan/Test-Harness-NG/

ACKNOWLEDGEMENTS

Top

SEE ALSO

Top

Test::Trap, Test::Run::Trap::Obj

COPYRIGHT & LICENSE

Top


Test-Run-CmdLine documentation Contained in the Test-Run-CmdLine distribution.

package Test::Run::CmdLine::Trap::ProveApp;

use strict;
use warnings;

use base 'Test::Run::Trap::Obj';

use Test::Trap qw( trap $trap :flow:stderr(systemsafe):stdout(systemsafe):warn );

sub trap_run
{
    my ($class, $args) = @_;

    my $cmdline = $args->{cmdline};

    trap { 
        system(
            $^X, "-MTest::Run::CmdLine::Prove::App", "-e", "run()", "--", 
            @$cmdline,
        );
    };

    return $class->new({ 
        ( map { $_ => $trap->$_() } 
        (qw(stdout stderr die leaveby exit return warn wantarray)))
    });
}

1;