in reply to Re^5: Creating coverage big report
in thread Creating coverage big report

Thank you for your help. I set the env to JSON but I still have the same error.
Is it possible to make the coverage module pass PERL5OPT only to spescific scripts? That way, the perl scripts of flow runner tool will not be reflected by it

Replies are listed 'Best First'.
Re^7: Creating coverage big report
by jcb (Parson) on Oct 04, 2019 at 00:58 UTC

    After changing the format, you will have to delete the old database.

    And no, the coverage module is being loaded by setting PERL5OPT so you will need to either filter those from the report (as explained in the manpage for cover) or just ignore them.

      Thanks again for the help. I'm still having the following error:
      malformed JSON string, neither array, object, number, string or atom, +at character offset 0 (before "pst0\x{5}\x{6}\x{3}\x{0}...") at /usr/ +pkgs/perl/5.14.1/lib64/module/Devel/Cover/DB/IO/JSON.pm line 33
      So I'm trying to use the ignore option:
      setenv DEVEL_COVER_OPTIONS '+ignore,/usr/pkgs/perl/,tests/' setenv DEVEL_COVER_DB_FORMAT JSON
      Using this flag, I'm trying to ignore all paths /usr/pkgs/perl/* but the error is still remains. How can I remove this error?

        The /usr/pkgs/perl/... in that message is the location in Perl code where the error was found and has nothing to do with code being tested for coverage. That error is complaining that a file expected to be in JSON instead had a Storable header. First, make sure to delete all of the Devel::Cover databases, and try again. If you get the same error again, one of your perl installations does not have JSON; either figure out which and install it there, or set DEVEL_COVER_DB_FORMAT to Storable, delete all of your Devel::Cover databases, and try again.

        Storable has been a core module longer than JSON has been in the Perl core, so you might have an older perl installation that has Storable but not JSON. Note that the troublesome installation is not the one producing the error — the error occurs when attempting to read a Storable file as JSON. Something else wrote the file in Storable format.