line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Run::CmdLine::Trap::Prove; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
22456
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
1469
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
extends('Test::Run::Trap::Obj'); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Test::Trap qw( trap $trap :flow:stderr(systemsafe):stdout(systemsafe):warn ); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has 'system_ret' => (is => "rw", isa => "Num"); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub trap_run |
15
|
|
|
|
|
|
|
{ |
16
|
|
|
|
|
|
|
my ($class, $args) = @_; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $cmdline = $args->{cmdline}; |
19
|
|
|
|
|
|
|
my $runprove = $args->{runprove}; |
20
|
|
|
|
|
|
|
my $system_ret; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
trap { $system_ret = system("$runprove $cmdline"); }; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
return $class->new({ |
25
|
|
|
|
|
|
|
( map { $_ => $trap->$_() } |
26
|
|
|
|
|
|
|
(qw(stdout stderr die leaveby exit return warn wantarray))), |
27
|
|
|
|
|
|
|
system_ret => $system_ret, |
28
|
|
|
|
|
|
|
}); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Test::Run::CmdLine::Trap::Prove - trap the output of a runprove run. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 DESCRIPTION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Testing class to trap the output of a runprove run. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 METHODS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 Test::Run::CmdLine::Trap::Prove->trap_run({runprove => $path_to_exe, cmdline => $cmdline}) |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Traps the output of the runprove $path_to_exe with the command line args |
46
|
|
|
|
|
|
|
of $cmdline. 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 |
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 |