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 - mt - single.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.14.0 lcov report (development 27775-aca467eab2) Lines: 23 30 76.7 %
Date: 2022-07-03 07:33:15 Functions: 10 15 66.7 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* Copyright (C) 2013  The PARI group.
       2             : 
       3             : This file is part of the PARI/GP package.
       4             : 
       5             : PARI/GP is free software; you can redistribute it and/or modify it under the
       6             : terms of the GNU General Public License as published by the Free Software
       7             : Foundation; either version 2 of the License, or (at your option) any later
       8             : version. It is distributed in the hope that it will be useful, but WITHOUT
       9             : ANY WARRANTY WHATSOEVER.
      10             : 
      11             : Check the License for details. You should have received a copy of it, along
      12             : with the package; see the file 'COPYING'. If not, write to the Free Software
      13             : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
      14             : #include "pari.h"
      15             : #include "paripriv.h"
      16             : #include "mt.h"
      17             : 
      18           0 : void mt_sigint_block(void) { }
      19           0 : void mt_sigint_unblock(void) { }
      20        9448 : void mt_err_recover(long er) { mtsingle_err_recover(er); }
      21        1540 : void pari_mt_close(void) { }
      22           0 : void mt_queue_reset(void) { }
      23          14 : void mt_broadcast(GEN code) {(void) code;}
      24           0 : void mt_thread_init(void) { }
      25             : 
      26             : void
      27           0 : mt_sigint(void) {}
      28             : 
      29             : int
      30     1279714 : mt_is_parallel(void)
      31             : {
      32     1279714 :   return 0;
      33             : }
      34             : 
      35             : int
      36   182660402 : mt_is_thread(void)
      37             : {
      38   182660402 :   return mtsingle_is_thread();
      39             : }
      40             : 
      41             : long
      42      581438 : mt_nbthreads(void)
      43             : {
      44      581438 :   return 1;
      45             : }
      46             : 
      47             : void
      48          46 : mt_export_add(const char *str, GEN val)
      49             : {
      50          46 :   if (mtsingle_is_thread())
      51           0 :     pari_err(e_MISC,"export not allowed during parallel sections");
      52          46 :   export_add(str, val);
      53          46 : }
      54             : 
      55             : void
      56          16 : mt_export_del(const char *str)
      57             : {
      58          16 :   if (mtsingle_is_thread())
      59           0 :     pari_err(e_MISC,"unexport not allowed during parallel sections");
      60          16 :   export_del(str);
      61          16 : }
      62             : 
      63             : void
      64        1540 : pari_mt_init(void)
      65             : {
      66        1540 :   pari_mt_nbthreads = 1;
      67        1540 : }
      68             : 
      69             : void
      70      287339 : mt_queue_start_lim(struct pari_mt *pt, GEN worker, long lim)
      71             : {
      72             :   (void) lim;
      73      287339 :   mtsingle_queue_start(pt, worker);
      74      287339 : }

Generated by: LCOV version 1.13