I am trying to record Perl coverage.
I use the ready to use Debian VM from Turnkey running Bugzilla. (https://www.turnkeylinux.org/download?file=turnkey-bugzilla-14.2-jessie-amd64-vmdk.zip)
I was able to install the perl coverage module Devel::Cover, and can record the coverage when executing a perl script in the console.
However, I have problems to record the coverage for the .cgi files when executing the Bugzilla webpage.
I tried several solutions but none led to success:
Setting the enviorment variable like:
export PERL5OPT"-MDevel::Cover"
(to always run perl with coverage) had no noticeable effect.Adding
use Devel::Cover;
to var/www/bugzilla/mod_perl.pl also had no noticeable effect.Adding
use Devel::Cover;
to var/www/bugzilla/index.cgi lead to an Internal Server Error when calling the Bugzilla page (the apache2 error log showed a permission error when trying to create directory cover_db). After changeing the permission in directory var/www/bugzilla to maximum access for all I still get the server error but the coverage for the error is recorded, which is weird (the error log shows a bad header error for index.cgi).I also tried to add the module fia the apache server configurations: etc/apache2/sites-enabled/bugzilla.conf by adding
SetEnv PERL5OPT "-MDevel::Cover=-dir,/var/www/bugzilla"
there, but this did also not have any noticeable effect.
Does anybody have an idea what the problem could be?
Or anything elso I should try? (I am new to Perl and also not much of a Linux expert)
Could it be a permissions issue, because the server is not run under root as far as I know, but www-data?
Thanks!