| 1 | package Tapper::Cmd; | ||||||||||||
| 2 | # git description: v5.0.12-3-gdcd21f5 | ||||||||||||
| 3 | |||||||||||||
| 4 | 24 | our $AUTHORITY = 'cpan:TAPPER'; | |||||||||||
| 5 | # ABSTRACT: Tapper - Backend functions for CLI and Web | ||||||||||||
| 6 | 24 | $Tapper::Cmd::VERSION = '5.0.14'; | |||||||||||
| 7 | 24 | ▶ | use Moose; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | 24 | extends 'Tapper::Base'; | |||||||||||
| 10 | |||||||||||||
| 11 | 24 | ▶ | use Tapper::Model 'model'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 12 | 24 | ▶ | use File::Slurp; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 13 | |||||||||||||
| 14 | has schema => ( | ||||||||||||
| 15 | is => 'rw', | ||||||||||||
| 16 | isa => 'Tapper::Schema::TestrunDB', | ||||||||||||
| 17 | 12 | ▶ | default => sub { return model('TestrunDB') }, | ||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||
| 18 | 24 | ); | |||||||||||
| 19 | |||||||||||||
| 20 | |||||||||||||
| 21 | |||||||||||||
| 22 | sub assign_preconditions | ||||||||||||
| 23 | 12 | ▶ | { | ||||||||||
|
Subroutine
assign_preconditions: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 24 | 12 | my ($self, $testrun_id, @preconditions) = @_; | |||||||||||
| 25 | 12 | my $testrun = model('TestrunDB')->resultset('Testrun')->find($testrun_id); | |||||||||||
| 26 | 12 | return $testrun->assign_preconditions(@preconditions); | |||||||||||
| 27 | |||||||||||||
| 28 | } | ||||||||||||
| 29 | |||||||||||||
| 30 | |||||||||||||
| 31 | # This apply_macro function allows access to reportdata and dpath. Thats | ||||||||||||
| 32 | # why it uses Tapper::Reports::DPath::TT instead of Template | ||||||||||||
| 33 | # directly. Thats because that way we can make testplans dependent on | ||||||||||||
| 34 | # former reports without doing it right. | ||||||||||||
| 35 | sub apply_macro | ||||||||||||
| 36 | 0 | ▶ | { | ||||||||||
|
Subroutine
apply_macro: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 37 | 0 | my ($self, $file, $substitutes, $includes) = @_; | |||||||||||
| 38 | |||||||||||||
| 39 | 0 | ▶ | $substitutes ||= {}; | ||||||||||
|
Condition0%0/2
$substitutes ||= {}
MC/DC0%0/1
$substitutes ||= {}
$substitutes
Truth table0%0/2
A
A= $substitutes
| |||||||||||||
| 40 | 0 | my $plan = File::Slurp::slurp($file); | |||||||||||
| 41 | |||||||||||||
| 42 | 0 | require Tapper::Config; | |||||||||||
| 43 | my @include_paths = (Tapper::Config->subconfig->{paths}{testplan_path}, | ||||||||||||
| 44 | 0 | Tapper::Config->subconfig->{paths}{use_case_path}); | |||||||||||
| 45 | 0 | ▶ | push @include_paths, @{$includes || [] }; | ||||||||||
|
Condition0%0/2
$includes || []
MC/DC0%0/1
$includes || []
$includes
Truth table0%0/2
A
A= $includes
| |||||||||||||
| 46 | 0 | my $include_path_list = join ":", @include_paths; | |||||||||||
| 47 | 0 | require Tapper::Reports::DPath::TT; | |||||||||||
| 48 | 0 | my $tt = Tapper::Reports::DPath::TT->new(include_path => $include_path_list, | |||||||||||
| 49 | substitutes => $substitutes, | ||||||||||||
| 50 | ); | ||||||||||||
| 51 | 0 | return $tt->render_template($plan); | |||||||||||
| 52 | } | ||||||||||||
| 53 | |||||||||||||
| 54 | |||||||||||||
| 55 | 24 | 1; # End of Tapper::Cmd | |||||||||||
| 56 | |||||||||||||
| 57 | __END__ | ||||||||||||