line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Run::CmdLine::Trap::ProveApp; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
28815
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
4
|
1
|
|
|
1
|
|
11
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use base 'Test::Run::Trap::Obj'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3262
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use Test::Trap qw( trap $trap :flow:stderr(systemsafe):stdout(systemsafe):warn ); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub trap_run |
11
|
|
|
|
|
|
|
{ |
12
|
|
|
|
|
|
|
my ($class, $args) = @_; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $cmdline = $args->{cmdline}; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
trap { |
17
|
|
|
|
|
|
|
system( |
18
|
|
|
|
|
|
|
$^X, "-MTest::Run::CmdLine::Prove::App", "-e", "run()", "--", |
19
|
|
|
|
|
|
|
@$cmdline, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
}; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
return $class->new({ |
24
|
|
|
|
|
|
|
( map { $_ => $trap->$_() } |
25
|
|
|
|
|
|
|
(qw(stdout stderr die leaveby exit return warn wantarray))) |
26
|
|
|
|
|
|
|
}); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 NAME |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Test::Run::CmdLine::Trap::ProveApp - trap the output of a run of |
34
|
|
|
|
|
|
|
L<Test::Run::CmdLine::Prove::App>. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 DESCRIPTION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Testing class to trap the output of a |
39
|
|
|
|
|
|
|
C<perl -MTest::Run::CmdLine::Prove::App ...> run. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 METHODS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 Test::Run::CmdLine::Trap::Prove->trap_run({cmdline => [@ARGS]}) |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Traps the output of the application with the command line args of C<@ARGS>. |
46
|
|
|
|
|
|
|
Returns the object. To be used as a constructor. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 AUTHORS |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Shlomi Fish, C<< <shlomif@iglu.org.il> >> |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 BUGS |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
55
|
|
|
|
|
|
|
C<bug-test-run-cmdline@rt.cpan.org>, or through the web interface at |
56
|
|
|
|
|
|
|
L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Run-CmdLine>. |
57
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on |
58
|
|
|
|
|
|
|
your bug as I make changes. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 SUPPORT |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
perldoc Test::Run::CmdLine::Trap::ProveApp |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
You can also look for information at: |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=over 4 |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
L<http://annocpan.org/dist/Test::Run::CmdLine> |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=item * CPAN Ratings |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
L<http://cpanratings.perl.org/d/Test::Run::CmdLine> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test::Run::CmdLine> |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=item * Search CPAN |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
L<http://search.cpan.org/dist/Test::Run::CmdLine/> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=back |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 SOURCE AVAILABILITY |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
The latest source of Test::Run::CmdLine is available from the Test::Run |
91
|
|
|
|
|
|
|
BerliOS Subversion repository: |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
L<https://svn.berlios.de/svnroot/repos/web-cpan/Test-Harness-NG/> |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 SEE ALSO |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
L<Test::Trap>, L<Test::Run::Trap::Obj> |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Copyright 2005 Shlomi Fish, all rights reserved. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
This program is released under the MIT X11 License. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=cut |