run-test.pl untested

filter: Statementstmt 0.0% 0 / 22 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 47 CC 5 SCAR 30.9
CC
5
Cov
0%
wanted
30.0
BEGIN
2.0
BEGIN
2.0
CRAP 22.0
1 #! /usr/bin/env perl
2  
3 use File::Find;
4 use Cwd;
5  
6 my $root = getcwd();
7  
8 if ($^O =~ 'MSWin'){
9 find( { wanted => \&wanted, no_chdir => 1 } , 'examples/');
10 } else {
11 my $cmd = "cd examples && strun --recurse --purge-cache --format production";
12 (system($cmd) == 0) or die "$cmd failed";
13 }
14  
15 my %seen;
16  
17 sub wanted {
18  
19 return unless $File::Find::name=~/(story|hook)\.(pl|rb|bash|py|pm|ps1)$/ or /meta\.txt$/;
20  
21 return unless -e $File::Find::dir."/windows.test";
22  
23 (my $dir = $File::Find::dir)=~s{examples/}{};
24  
25 return if $dir=~/modules/;
26  
27 return if $seen{$dir};
28
29 my $cmd = "cd examples && strun --purge-cache --story $dir --format production";
30  
31 (system($cmd) == 0) or die "$cmd failed";
32  
33 $seen{$dir}++;
34  
35 }
36  
37