The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test2::Harness::Proc - Handle on a running test process.

DESCRIPTION

This object is a handle on a running test process. You can use this to check if the process is still running, send it input, read lines of output, and check exit value.

METHODS

$str = $proc->encoding

Get the encoding (if set).

$io = $proc->err_fh

Get the STDERR handle for reading.

$io = $proc->out_fh

Get the STDOUT handle for reading.

$io = $proc->in_fh

Get the STDIN handle for writing.

$exit = $proc->exit

Get the exit value. This will be undefined if the process is still running.

$file = $proc->file

Get the filename for the test being run.

$line = $proc->get_err_line
$line = $proc->get_err_line(peek => 1)

Get a single line of output from STDERR. If peek is set then the line is remembered and will be retrieved again on the nest call to get_err_line.

$proc->get_out_line
$proc->get_out_line(peek => 1)

Get a single line of output from STDOUT. If peek is set then the line is remembered and will be retrieved again on the nest call to get_out_line.

$bool = $proc->is_done

Check if the process is done or still running. This also sets the exit attribute if the process is done.

$pid = $proc->pid

PID of the child process.

$proc->write($line)

Send data to the child process via it's STDIN.

SOURCE

The source code repository for Test2-Harness can be found at http://github.com/Test-More/Test2-Harness/.

MAINTAINERS

Chad Granum <exodist@cpan.org>

AUTHORS

Chad Granum <exodist@cpan.org>

COPYRIGHT

Copyright 2016 Chad Granum <exodist7@gmail.com>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://dev.perl.org/licenses/