1Test::Alien::Run(3) User Contributed Perl Documentation Test::Alien::Run(3)
2
3
4
6 Test::Alien::Run - Run object
7
9 version 2.47
10
12 use Test2::V0;
13 use Test::Alien;
14
15 run_ok([ $^X, -e => 'print "some output"; exit 22'])
16 ->exit_is(22)
17 ->out_like(qr{some});
18
20 This class stores information about a process run as performed by
21 Test::Alien#run_ok. That function is the ONLY way to create an
22 instance of this class.
23
25 out
26 my $str = $run->out;
27
28 The standard output from the run.
29
30 err
31 my $str = $run->err;
32
33 The standard error from the run.
34
35 exit
36 my $int = $run->exit;
37
38 The exit value of the run.
39
40 signal
41 my $int = $run->signal;
42
43 The signal that killed the run, or zero if the process was terminated
44 normally.
45
47 These methods return the run object itself, so they can be chained, as
48 in the synopsis above.
49
50 success
51 $run->success;
52 $run->success($message);
53
54 Passes if the process terminated normally with an exit value of 0.
55
56 exit_is
57 $run->exit_is($exit);
58 $run->exit_is($exit, $message);
59
60 Passes if the process terminated with the given exit value.
61
62 exit_isnt
63 $run->exit_isnt($exit);
64 $run->exit_isnt($exit, $message);
65
66 Passes if the process terminated with an exit value of anything but the
67 given value.
68
69 out_like
70 $run->out_like($regex);
71 $run->out_like($regex, $message);
72
73 Passes if the output of the run matches the given pattern.
74
75 out_unlike
76 $run->out_unlike($regex);
77 $run->out_unlike($regex, $message);
78
79 Passes if the output of the run does not match the given pattern.
80
81 err_like
82 $run->err_like($regex);
83 $run->err_like($regex, $message);
84
85 Passes if the standard error of the run matches the given pattern.
86
87 err_unlike
88 $run->err_unlike($regex);
89 $run->err_unlike($regex, $message);
90
91 Passes if the standard error of the run does not match the given
92 pattern.
93
94 note
95 $run->note;
96
97 Send the output and standard error as test note.
98
99 diag
100 $run->diag;
101
102 Send the output and standard error as test diagnostic.
103
105 Test::Alien
106
108 Author: Graham Ollis <plicease@cpan.org>
109
110 Contributors:
111
112 Diab Jerius (DJERIUS)
113
114 Roy Storey (KIWIROY)
115
116 Ilya Pavlov
117
118 David Mertens (run4flat)
119
120 Mark Nunberg (mordy, mnunberg)
121
122 Christian Walde (Mithaldu)
123
124 Brian Wightman (MidLifeXis)
125
126 Zaki Mughal (zmughal)
127
128 mohawk (mohawk2, ETJ)
129
130 Vikas N Kumar (vikasnkumar)
131
132 Flavio Poletti (polettix)
133
134 Salvador Fandiño (salva)
135
136 Gianni Ceccarelli (dakkar)
137
138 Pavel Shaydo (zwon, trinitum)
139
140 Kang-min Liu (劉康民, gugod)
141
142 Nicholas Shipp (nshp)
143
144 Juan Julián Merelo Guervós (JJ)
145
146 Joel Berger (JBERGER)
147
148 Petr Písař (ppisar)
149
150 Lance Wicks (LANCEW)
151
152 Ahmad Fatoum (a3f, ATHREEF)
153
154 José Joaquín Atria (JJATRIA)
155
156 Duke Leto (LETO)
157
158 Shoichi Kaji (SKAJI)
159
160 Shawn Laffan (SLAFFAN)
161
162 Paul Evans (leonerd, PEVANS)
163
164 Håkon Hægland (hakonhagland, HAKONH)
165
166 nick nauwelaerts (INPHOBIA)
167
169 This software is copyright (c) 2011-2020 by Graham Ollis.
170
171 This is free software; you can redistribute it and/or modify it under
172 the same terms as the Perl 5 programming language system itself.
173
174
175
176perl v5.34.0 2022-03-07 Test::Alien::Run(3)