Bug 13899: Changing license to GPLv3
[koha-ffzg.git] / misc / devel / coverage.pl
1 #!/usr/bin/perl
2
3 # Copyright 2015 BibLibre
4 #
5 # This file is part of Koha.
6 #
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 3 of the License, or (at your option) any later
10 # version.
11 #
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License along
17 # with Koha; if not, see <http://www.gnu.org/licenses>.
18
19 =head1 NAME
20
21 coverage.pl
22
23 =head1 SYNOPSIS
24
25 You have to be in yout Koha/src directory
26 ./misc/devel/coverage.pl
27
28 =head1 DESCRIPTION
29
30 This script make a cover on all files to see which modules are not tested yet
31
32 =cut
33
34 use Modern::Perl;
35 use C4::Context;
36 use Cwd;
37
38 #Die if you are not in your Koha src directory
39 my $KOHA_PATH = C4::Context->config("intranetdir");
40 die "ERROR : You are not in Koha src/ directory"
41   unless $KOHA_PATH eq getcwd;
42
43 # Delete old coverage
44 system("cover -delete");
45
46 #Start the cover
47 system("PERL5OPT=-MDevel::Cover /usr/bin/prove -r t/");
48
49 #Create the HTML output
50 system("cover");
51 say("file://$KOHA_PATH/cover_db/coverage.html")
52   unless !-e "$KOHA_PATH/cover_db/coverage.html";