From 54312cb5956edf299e19e9000a25c19d25879ba5 Mon Sep 17 00:00:00 2001 From: Julian FIOL Date: Tue, 24 Mar 2015 11:46:10 +0100 Subject: [PATCH] Bug 13899: Adding misc/devel/coverage.pl It's a script making a cover on all modules to see which ones are not tested yet. It uses Devel::Cover Signed-off-by: Bernardo Gonzalez Kriegel Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- misc/devel/coverage.pl | 58 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 misc/devel/coverage.pl diff --git a/misc/devel/coverage.pl b/misc/devel/coverage.pl new file mode 100755 index 0000000000..804fc8d2ed --- /dev/null +++ b/misc/devel/coverage.pl @@ -0,0 +1,58 @@ +#!/usr/bin/perl + +# Copyright 2015 BibLibre +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +=head1 NAME + +coverage.pl + +=head1 SYNOPSIS + +./misc/devel/coverage.pl + +=head1 DESCRIPTION + +This script make a cover on all files to see which modules are not tested yet + +=cut + +use Modern::Perl; +use C4::Context; + +my $KOHA_PATH = C4::Context->config("intranetdir"); + +chdir $KOHA_PATH; + +eval{ + require Devel::Cover; +}; + +if ($@) { + say "Devel::Cover needs to be installed"; + exit 1; +} + +#Delete old coverage +system("cover -delete"); + +#Start the cover +system("PERL5OPT=-MDevel::Cover /usr/bin/prove -r t/"); + +#Create the HTML output +system("cover"); + +say("file://$KOHA_PATH/cover_db/coverage.html"); \ No newline at end of file -- 2.39.5