lib/Test/FitNesse/Slim/ListExecutor.pm

filter: Statementstmt 100% 29 / 29 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 4 / 4 totaltotal 100% 45 / 45 CC 4 SCAR 7.4
CC
4
Cov
100%
execute_with
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« lib/Test/FitNesse/Slim/MapResult.pm ↑ Summary lib/Test/FitNesse/Slim/SlimHelperLibrary.pm »
1 package Test::FitNesse::Slim::ListExecutor;
2  
3 62 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 62 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 62 ▶use Test::FitNesse::Slim::Statement;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 62 ▶use Test::FitNesse::Slim::StatementExecutor;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 122 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
10 122 my($class,%options) = @_;
11 122 my $executor = Test::FitNesse::Slim::StatementExecutor->new(%options);
12 122 bless { EXECUTOR => $executor } => $class;
13 }
14  
15 146 ▶sub executor { $_[0]->{EXECUTOR} }
Subroutine executor: called CC=1 SCAR=0.0
Pod documented
16  
17 106 ▶sub execute {
Subroutine execute: called CC=1 SCAR=0.0
Pod documented
18 106 my($self,@statements) = @_;
19 106 $self->execute_with(undef, @statements);
20 }
21  
22 130 ▶sub execute_with {
Subroutine execute_with: called CC=4 SCAR=13.9
Pod documented
23 130 my($self,$after_statement,@statements) = @_;
24 130 my $executor = $self->executor;
25 130 my @results;
26 130 for my $statement (@statements) {
27 389 ▶ last if $executor->stop_requested;
Branch: 1 branch
BranchTrueFalseTotal
if $executor->stop_requested 7 382 389
28 382 my $result = Test::FitNesse::Slim::Statement->execute($executor, @$statement);
29 382 push @results, $result;
30 382 ▶ $after_statement->($statement,$result) if $after_statement;
Branch: 1 branch
BranchTrueFalseTotal
if $after_statement 40 342 382
31 }
32 130 $executor->reset_stop_requested;
33 130 @results;
34 }
35  
36 62 1;
37  
38 =head1 NAME
39  
40 Test::FitNesse::Slim::ListExecutor - Execute a decoded batch of SLiM instructions
41  
42 =head1 DESCRIPTION
43  
44 The list executor owns one L<Test::FitNesse::Slim::StatementExecutor> for a protocol
45 session. It applies instructions in order, stops the current batch when a
46 FitNesse stop marker is raised, and resets that marker before the next
47 batch. It is an internal server component rather than a fixture API.
48  
49 =head1 METHODS
50  
51 =head2 new
52  
53 my $executor = Test::FitNesse::Slim::ListExecutor->new(%options);
54  
55 Create a session executor. C<statement_timeout> is forwarded to the
56 statement executor and limits each fixture invocation when defined.
57  
58 =head2 executor
59  
60 Return the underlying statement executor. The method is used by the server
61 and integration tests to inspect session state.
62  
63 =head2 execute
64  
65 Execute decoded statement array references in order and return their
66 result array references. Each instruction is handled independently by
67 L<Test::FitNesse::Slim::Statement>.
68  
69 =head2 execute_with
70  
71 my @results = $executor->execute_with($after_statement, @statements);
72  
73 Execute a batch and optionally invoke C<$after_statement> with each
74 statement and result after execution. The callback is used by pipe output
75 tunneling; its exceptions propagate to the server.
76  
77 =cut
« lib/Test/FitNesse/Slim/MapResult.pm ↑ Summary lib/Test/FitNesse/Slim/SlimHelperLibrary.pm »