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) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31041-bd73e9fcdd) Lines: 74.2 % 31 23
Test Date: 2026-07-22 22:45:42 Functions: 62.5 % 16 10
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        11252 : void mt_err_recover(long er) { mtsingle_err_recover(er); }
      21            0 : void mt_break_recover(void) { mtsingle_err_recover(0); }
      22         1618 : void pari_mt_close(void) { }
      23            0 : void mt_queue_reset(void) { }
      24           10 : void mt_broadcast(GEN code) {(void) code;}
      25            0 : void mt_thread_init(void) { }
      26              : 
      27              : void
      28            0 : mt_sigint(void) {}
      29              : 
      30              : int
      31      1324766 : mt_is_parallel(void)
      32              : {
      33      1324766 :   return 0;
      34              : }
      35              : 
      36              : int
      37    186639092 : mt_is_thread(void)
      38              : {
      39    186639092 :   return mtsingle_is_thread();
      40              : }
      41              : 
      42              : long
      43      2431560 : mt_nbthreads(void)
      44              : {
      45      2431560 :   return 1;
      46              : }
      47              : 
      48              : void
      49           46 : mt_export_add(const char *str, GEN val)
      50              : {
      51           46 :   if (mtsingle_is_thread())
      52            0 :     pari_err(e_MISC,"export not allowed during parallel sections");
      53           46 :   export_add(str, val);
      54           46 : }
      55              : 
      56              : void
      57           16 : mt_export_del(const char *str)
      58              : {
      59           16 :   if (mtsingle_is_thread())
      60            0 :     pari_err(e_MISC,"unexport not allowed during parallel sections");
      61           16 :   export_del(str);
      62           16 : }
      63              : 
      64              : void
      65         1618 : pari_mt_init(void)
      66              : {
      67         1618 :   pari_mt_nbthreads = 1;
      68         1618 : }
      69              : 
      70              : void
      71      1004109 : mt_queue_start_lim(struct pari_mt *pt, GEN worker, long lim)
      72              : {
      73              :   (void) lim;
      74      1004109 :   mtsingle_queue_start(pt, worker);
      75      1004109 : }
        

Generated by: LCOV version 2.0-1