File Coverage

blib/lib/Test/Count/Filter/ByFileType/App.pm
Criterion Covered Total %
statement 15 25 60.0
branch 0 4 0.0
condition n/a
subroutine 5 6 83.3
pod 1 1 100.0
total 21 36 58.3


line stmt bran cond sub pod time code
1             package Test::Count::Filter::ByFileType::App;
2             $Test::Count::Filter::ByFileType::App::VERSION = '0.1104';
3 1     1   1766 use strict;
  1         2  
  1         33  
4 1     1   5 use warnings;
  1         3  
  1         30  
5              
6 1     1   552 use Test::Count::Filter ();
  1         3  
  1         24  
7 1     1   810 use Getopt::Long qw/ GetOptions /;
  1         10837  
  1         5  
8              
9 1     1   187 use parent 'Exporter';
  1         2  
  1         5  
10              
11             our @EXPORT = (qw(run));
12              
13              
14             sub run
15             {
16 0     0 1   my $filetype = "perl";
17 0           GetOptions( 'ft=s' => \$filetype );
18              
19 0           my %params = (
20             'lisp' => {
21             assert_prefix_regex => qr{; TEST},
22             plan_prefix_regex => qr{\(plan\s+},
23             },
24             'c' => {
25             assert_prefix_regex => qr{/[/\*]\s+TEST},
26             plan_prefix_regex => qr{\s*plan_tests\s*\(\s*},
27             },
28             'python' => {
29             plan_prefix_regex => qr{plan\s*\(\s*},
30             },
31             );
32              
33 0           my %aliases = (
34             'arc' => "lisp",
35             'scheme' => "lisp",
36             'cpp' => "c",
37             );
38              
39 0 0         $filetype = exists( $aliases{$filetype} ) ? $aliases{$filetype} : $filetype;
40 0 0         my $ft_params = exists( $params{$filetype} ) ? $params{$filetype} : +{};
41              
42 0           my $filter = Test::Count::Filter->new( { %{$ft_params}, } );
  0            
43              
44 0           $filter->process();
45              
46 0           return 0;
47             }
48              
49             1;
50              
51             __END__