lib/Rex/Test.pm

filter: Statementstmt 66.6% 24 / 36 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 63.6% 7 / 11 Podpod 0.0% 0 / 1 totaltotal 57.4% 31 / 54 CC 5 SCAR 15.3
CC
5
Cov
57%
__ANON__
12.0
__ANON__
6.0
__ANON__
6.0
CRAP 4.6
« lib/Rex/Virtualization/LibVirt/clone.pm ↑ Summary lib/Rex/Resource.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4  
5 package Rex::Test;
6  
7 1 ▶use v5.14.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Rex -base;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Rex::Commands::Box;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 require Rex::CLI;
13  
14 1 our $VERSION = '1.16.1'; # VERSION
15  
16 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶ use Rex::Shared::Var;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 share qw(@exit);
19 }
20  
21 Rex::CLI->add_exit(
22 0 ▶ sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
23 0 ▶ if ( scalar @exit > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @Rex::Test::exit > 0) 0 0 0
24 0 CORE::exit(1);
25 }
26 }
27 1 );
28  
29 0 ▶sub push_exit {
Subroutine push_exit: not called CC=1 SCAR=6.9
Pod undocumented
30 0 push @exit, shift;
31 }
32  
33 1 desc 'Run tests specified with --test=testfile (default: t/*.t)';
34 0 ▶task run => make {
Subroutine __ANON__: not called CC=3 SCAR=24.8
35 0 Rex::Logger::info("Running integration tests...");
36  
37 0 my $parameters = shift;
38 0 my @files;
39  
40 0 ▶ LOCAL {
Subroutine __ANON__: not called CC=2 SCAR=17.9
41 @files =
42 0 ▶ defined $parameters->{test} ? glob( $parameters->{test} ) : glob('t/*.t');
Branch: 1 branch
BranchTrueFalseTotal
defined $parameters->{'test'} ? : 0 0 0
43 0 };
44  
45 0 for my $file (@files) {
46 0 Rex::Logger::info("Running test: $file.");
47 0 do "./$file";
48 0 ▶ Rex::Logger::info( "Error running $file: $@", "error" ) if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 0 0
49 }
50 1 };
51  
52 1 1;
« lib/Rex/Virtualization/LibVirt/clone.pm ↑ Summary lib/Rex/Resource.pm »