Code coverage tests

This page documents the degree to which the PARI/GP source code is tested by our public test suite, distributed with the source distribution in directory src/test/. This is measured by the gcov utility; we then process gcov output using the lcov frond-end.

We test a few variants depending on Configure flags on the pari.math.u-bordeaux.fr machine (x86_64 architecture), and agregate them in the final report:

The target is to exceed 90% coverage for all mathematical modules (given that branches depending on DEBUGLEVEL or DEBUGMEM are not covered). This script is run to produce the results below.

LCOV - code coverage report
Current view: top level - graph - plotsvg.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.0 lcov report (development 29712-7c8a932571) Lines: 12 16 75.0 %
Date: 2024-11-15 09:08:45 Functions: 1 2 50.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* Copyright (C) 2017  The PARI group.
       2             : 
       3             : This file is part of the PARI/GP package.
       4             : 
       5             : This program is free software; you can redistribute it and/or modify
       6             : it under the terms of the GNU General Public License as published by
       7             : the Free Software Foundation; either version 2 of the License, or
       8             : (at your option) any later version.
       9             : 
      10             : This program is distributed in the hope that it will be useful,
      11             : but WITHOUT ANY WARRANTY; without even the implied warranty of
      12             : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      13             : GNU General Public License for more details.
      14             : 
      15             : You should have received a copy of the GNU General Public License along
      16             : with this program; if not, write to the Free Software Foundation, Inc.,
      17             : 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      18             : */
      19             : #include "pari.h"
      20             : #include "rect.h"
      21             : 
      22             : static void
      23           0 : draw(PARI_plot *T, GEN w, GEN x, GEN y)
      24             : {
      25           0 :   if (pari_daemon()) return;  /* parent process returns */
      26           0 :   pari_plot_by_file("GP_SVG_VIEWER", ".svg", rect2svg(w,x,y,T));
      27           0 :   exit(0);
      28             : }
      29             : void
      30           2 : gp_get_plot(PARI_plot *T)
      31             : {
      32           2 :   T->width   = 480;
      33           2 :   T->height  = 320;
      34           2 :   T->fheight = 12;
      35           2 :   T->fwidth  = 6;
      36           2 :   T->hunit   = 3;
      37           2 :   T->vunit   = 3;
      38           2 :   gp_get_ploth_default_sizes(T);
      39           2 :   T->dwidth  = 0;
      40           2 :   T->dheight = 0;
      41           2 :   T->draw = &draw;
      42           2 : }

Generated by: LCOV version 1.16