line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# (c) Jan Gehring |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Rex::Test; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
13
|
use v5.12.5; |
|
1
|
|
|
|
|
5
|
|
8
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
51
|
|
9
|
1
|
|
|
1
|
|
7
|
use Rex -base; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
10
|
1
|
|
|
1
|
|
7
|
use Data::Dumper; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
58
|
|
11
|
1
|
|
|
1
|
|
6
|
use Rex::Commands::Box; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
12
|
|
|
|
|
|
|
require Rex::CLI; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '1.14.2.2'; # TRIAL VERSION |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
BEGIN { |
17
|
1
|
|
|
1
|
|
7
|
use Rex::Shared::Var; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
88
|
|
18
|
1
|
|
|
1
|
|
26
|
share qw(@exit); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Rex::CLI->add_exit( |
22
|
|
|
|
|
|
|
sub { |
23
|
|
|
|
|
|
|
if ( scalar @exit > 0 ) { |
24
|
|
|
|
|
|
|
CORE::exit(1); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub push_exit { |
30
|
0
|
|
|
0
|
0
|
|
push @exit, shift; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
desc 'Run tests specified with --test=testfile (default: t/*.t)'; |
34
|
|
|
|
|
|
|
task run => make { |
35
|
|
|
|
|
|
|
Rex::Logger::info("Running integration tests..."); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
my $parameters = shift; |
38
|
|
|
|
|
|
|
my @files; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
LOCAL { |
41
|
|
|
|
|
|
|
@files = |
42
|
|
|
|
|
|
|
defined $parameters->{test} ? glob( $parameters->{test} ) : glob('t/*.t'); |
43
|
|
|
|
|
|
|
}; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
for my $file (@files) { |
46
|
|
|
|
|
|
|
Rex::Logger::info("Running test: $file."); |
47
|
|
|
|
|
|
|
do "./$file"; |
48
|
|
|
|
|
|
|
Rex::Logger::info( "Error running $file: $@", "error" ) if $@; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
}; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |