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 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 - mt.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.10.0 lcov report (development 21041-7a7d034) Lines: 34 35 97.1 %
Date: 2017-09-20 06:24:43 Functions: 11 11 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* $Id$
       2             : 
       3             : Copyright (C) 2013  The PARI group.
       4             : 
       5             : This file is part of the PARI/GP package.
       6             : 
       7             : PARI/GP is free software; you can redistribute it and/or modify it under the
       8             : terms of the GNU General Public License as published by the Free Software
       9             : Foundation. It is distributed in the hope that it will be useful, but WITHOUT
      10             : ANY WARRANTY WHATSOEVER.
      11             : 
      12             : Check the License for details. You should have received a copy of it, along
      13             : with the package; see the file 'COPYING'. If not, write to the Free Software
      14             : Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
      15             : #include "pari.h"
      16             : #include "paripriv.h"
      17             : #include "mt.h"
      18             : 
      19             : static GEN
      20      613596 : mtsingle_queue_get(struct mt_state *mt, long *workid, long *pending)
      21             : {
      22      613596 :   GEN done = mt->pending;
      23      613596 :   if (workid) *workid = mt->workid;
      24      613596 :   mt->pending = NULL; *pending = 0;
      25      613596 :   return done;
      26             : }
      27             : 
      28             : static void
      29      613604 : mtsingle_queue_submit(struct mt_state *mt, long workid, GEN work)
      30             : {
      31      613604 :   mt->pending = work? closure_callgenvec(mt->worker, work): NULL;
      32      613596 :   mt->workid = workid;
      33      613596 : }
      34             : 
      35             : static void
      36       44940 : mtsingle_queue_end(void) {  }
      37             : 
      38             : void
      39       44948 : mtsingle_queue_start(struct pari_mt *pt, GEN worker)
      40             : {
      41       44948 :   pt->get = mtsingle_queue_get;
      42       44948 :   pt->submit = mtsingle_queue_submit;
      43       44948 :   pt->end = mtsingle_queue_end;
      44       44948 :   pt->mt.worker = worker;
      45       44948 :   pt->mt.pending = NULL;
      46       44948 : }
      47             : 
      48             : void
      49       51571 : mt_queue_end(struct pari_mt *pt) { pt->end(); }
      50             : 
      51             : void
      52      788512 : mt_queue_submit(struct pari_mt *pt, long workid, GEN work)
      53      788512 : { pt->submit(&pt->mt, workid, work); }
      54             : 
      55             : GEN
      56      788504 : mt_queue_get(struct pari_mt *pt, long *workid, long *pending)
      57      788504 : { return pt->get(&pt->mt, workid, pending); }
      58             : 
      59             : void
      60         193 : mt_queue_start(struct pari_mt *pt, GEN worker)
      61         193 : { return mt_queue_start_lim(pt, worker, 0); }
      62             : 
      63             : void
      64     1317556 : mtstate_save(long *pending)
      65             : {
      66     1317556 :   *pending = mt_is_parallel();
      67     1317556 : }
      68             : 
      69             : void
      70       22557 : mtstate_restore(long *pending)
      71             : {
      72       22557 :   if (!*pending && mt_is_parallel())
      73           4 :     mt_queue_reset();
      74       22557 : }
      75             : 
      76             : void
      77         228 : mtstate_reset(void)
      78             : {
      79         228 :   if (mt_is_parallel())
      80           0 :     mt_queue_reset();
      81         228 : }

Generated by: LCOV version 1.11