File Coverage

blib/lib/Test/Detect.pm
Criterion Covered Total %
statement 13 13 100.0
branch 2 2 100.0
condition 6 6 100.0
subroutine 5 5 100.0
pod 1 1 100.0
total 27 27 100.0


line stmt bran cond sub pod time code
1             package Test::Detect;
2              
3 1     1   20863 use strict;
  1         2  
  1         31  
4 1     1   4 use warnings;
  1         2  
  1         38  
5              
6             $Test::Detect::VERSION = '0.1';
7              
8             sub import {
9 1     1   4 no strict 'refs'; ## no critic
  1         5  
  1         90  
10 2     2   264 *{ caller() . '::detect_testing' } = \&detect_testing;
  2         16  
11             }
12              
13             sub detect_testing {
14              
15             # anything to add/modify/remove? send patches!!
16 4 100 100 4 1 1240 return 1 if exists $ENV{'TAP_VERSION'} || exists $INC{'Test/More.pm'} || exists $INC{'Test/Builder.pm'};
      100        
17              
18             # would be nice if we could detect execution of prove *but* $^X is still perl when calling prove
19              
20 1         19 return;
21             }
22              
23             1;
24              
25             __END__