/usr/share/perl5/Lire/Test/CommandResult.pm is in lire 2:2.1.1-2.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | package Lire::Test::CommandResult;
use strict;
=pod
=head1 NAME
Lire::Test::CommandResult - Object used to report the results of shell commands
=head1 SYNOPSIS
use Lire::Test::FunctionalTestCase;
my $result = $self->lire_run( "echo Test" );
print $result->status();
print $result->stdout();
print $result->stderr();
print scalar $result->sent_mail(), " emails were sent.\n";
=head1 DESCRIPTION
Lire::Test::ComandResult objects are used to report the results
of shell commands run through Lire::Test::FunctionalTestCase::lire_run().
=cut
sub new {
my $class = shift;
return bless { @_ }, $class;
}
=pod
=head2 command()
Returns the shell command that was run. This is the complete command line
which was interpreated by the shell.
=cut
sub command {
return $_[0]{'_command'};
}
=pod
=head2 status()
Returns the command result status. (What is usually contained in $?).
=cut
sub status {
return $_[0]{'_status'};
}
=pod
=head2 stdout()
Returns what was output on stdout while executing the command.
=cut
sub stdout {
return $_[0]{'_stdout'};
}
=pod
=head2 stderr()
Returns what was output on stderr while executing the command.
=cut
sub stderr {
return $_[0]{'_stderr'};
}
=pod
=head2 sent_mail()
Returns in an array reference the message that were sent out during
this command run. The element of this array are hash reference
containing two keys:
=over
=item recipients
An array reference containing the recipients as passed on the command
line to sendmail.
=item message
The email which was sent. This is the complete text of the email. This
is what was passed to sendmail via STDIN.
=back
=cut
sub sent_mail {
return $_[0]{'_sent_mail'};
}
1;
__END__
=pod
=head1 SEE ALSO
Lire::Test::FunctionaLTestCase(3pm)
=head1 VERSION
$Id: CommandResult.pm,v 1.6 2006/07/23 13:16:31 vanbaal Exp $
=head1 AUTHOR
Francis J. Lacoste <flacoste@logreport.org>
=head1 COPYRIGHT
Copyright (C) 2003 Stichting LogReport Foundation LogReport@LogReport.org
This file is part of Lire.
Lire is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program (see COPYING); if not, check with
http://www.gnu.org/copyleft/gpl.html.
=cut
|