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.12.0 lcov report (development 23344-f0cc1b3f6) Lines: 12 27 44.4 %
Date: 2018-12-12 05:41:43 Functions: 6 13 46.2 %
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. It is distributed in the hope that it will be useful, but WITHOUT
       8             : ANY WARRANTY WHATSOEVER.
       9             : 
      10             : Check the License for details. You should have received a copy of it, along
      11             : with the package; see the file 'COPYING'. If not, write to the Free Software
      12             : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
      13             : #include "pari.h"
      14             : #include "paripriv.h"
      15             : #include "mt.h"
      16             : 
      17           0 : void mt_sigint_block(void) { }
      18           0 : void mt_sigint_unblock(void) { }
      19        7838 : void mt_err_recover(long er) { (void)er; }
      20        1326 : void pari_mt_close(void) { }
      21           0 : void mt_queue_reset(void) { }
      22           0 : void mt_broadcast(GEN code) {(void) code;}
      23             : 
      24             : void
      25           0 : mt_sigint(void) {}
      26             : 
      27             : int
      28     1211622 : mt_is_parallel(void)
      29             : {
      30     1211622 :   return 0;
      31             : }
      32             : 
      33             : int
      34   166725543 : mt_is_thread(void)
      35             : {
      36   166725543 :   return mtsingle_is_thread();
      37             : }
      38             : 
      39             : void
      40           0 : mt_export_add(const char *str, GEN val)
      41             : {
      42           0 :   if (mtsingle_is_thread())
      43           0 :     pari_err(e_MISC,"export not allowed during parallel sections");
      44           0 :   export_add(str, val);
      45           0 : }
      46             : 
      47             : void
      48           0 : mt_export_del(const char *str)
      49             : {
      50           0 :   if (mtsingle_is_thread())
      51           0 :     pari_err(e_MISC,"unexport not allowed during parallel sections");
      52           0 :   export_del(str);
      53           0 : }
      54             : 
      55             : void
      56        1326 : pari_mt_init(void)
      57             : {
      58        1326 :   pari_mt_nbthreads = 1;
      59        1326 : }
      60             : 
      61             : void
      62       79020 : mt_queue_start_lim(struct pari_mt *pt, GEN worker, long lim)
      63             : {
      64             :   (void) lim;
      65       79020 :   mtsingle_queue_start(pt, worker);
      66       79020 : }

Generated by: LCOV version 1.13