Lines 22-39
coverage.pl
Link Here
|
22 |
|
22 |
|
23 |
=head1 SYNOPSIS |
23 |
=head1 SYNOPSIS |
24 |
|
24 |
|
25 |
You have to be in yout Koha/src directory |
25 |
misc/devel/coverage.pl [-h|--help] |
26 |
./misc/devel/coverage.pl |
26 |
|
|
|
27 |
This script must be run from your Koha source tree. |
27 |
|
28 |
|
28 |
=head1 DESCRIPTION |
29 |
=head1 DESCRIPTION |
29 |
|
30 |
|
30 |
This script make a cover on all files to see which modules are not tested yet |
31 |
This script runs all Koha tests and generates a coverage report on the |
|
|
32 |
cover_db directory. |
33 |
|
34 |
=cut |
35 |
|
36 |
=head1 OPTIONS |
37 |
|
38 |
=over 8 |
39 |
|
40 |
=item B<-h|--help> |
41 |
|
42 |
prints this help text |
43 |
|
44 |
=back |
31 |
|
45 |
|
32 |
=cut |
46 |
=cut |
33 |
|
47 |
|
34 |
use Modern::Perl; |
48 |
use Modern::Perl; |
|
|
49 |
|
35 |
use C4::Context; |
50 |
use C4::Context; |
36 |
use Cwd; |
51 |
use Cwd; |
|
|
52 |
use Getopt::Long; |
53 |
use Pod::Usage; |
54 |
|
55 |
my $help; |
56 |
|
57 |
GetOptions( |
58 |
"h|help" => \$help |
59 |
); |
60 |
|
61 |
pod2usage(1) if defined $help; |
37 |
|
62 |
|
38 |
#Die if you are not in your Koha src directory |
63 |
#Die if you are not in your Koha src directory |
39 |
my $KOHA_PATH = C4::Context->config("intranetdir"); |
64 |
my $KOHA_PATH = C4::Context->config("intranetdir"); |
Lines 50-52
system("PERL5OPT=-MDevel::Cover /usr/bin/prove -r t/");
Link Here
|
50 |
system("cover"); |
75 |
system("cover"); |
51 |
say("file://$KOHA_PATH/cover_db/coverage.html") |
76 |
say("file://$KOHA_PATH/cover_db/coverage.html") |
52 |
unless !-e "$KOHA_PATH/cover_db/coverage.html"; |
77 |
unless !-e "$KOHA_PATH/cover_db/coverage.html"; |
53 |
- |
78 |
|
|
|
79 |
1; |