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-bordeaux1.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.8.0 lcov report (development 16791-0d1274a) Lines: 9 33 27.3 %
Date: 2014-09-16 Functions: 3 10 30.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 3 10 30.0 %

           Branch data     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                 :          0 : mtsingle_queue_get(struct mt_state *mt, long *workid, long *pending)
      21                 :            : {
      22                 :          0 :   GEN done = mt->pending;
      23         [ #  # ]:          0 :   if (workid) *workid = mt->workid;
      24                 :          0 :   mt->pending = NULL; *pending = 0;
      25                 :          0 :   return done;
      26                 :            : }
      27                 :            : 
      28                 :            : static void
      29                 :          0 : mtsingle_queue_submit(struct mt_state *mt, long workid, GEN work)
      30                 :            : {
      31         [ #  # ]:          0 :   mt->pending = work? closure_callgenvec(mt->worker, work): NULL;
      32                 :          0 :   mt->workid = workid;
      33                 :          0 : }
      34                 :            : 
      35                 :            : static void
      36                 :          0 : mtsingle_queue_end(void) {  }
      37                 :            : 
      38                 :            : void
      39                 :          0 : mtsingle_queue_start(struct pari_mt *pt, GEN worker)
      40                 :            : {
      41                 :          0 :   pt->get = mtsingle_queue_get;
      42                 :          0 :   pt->submit = mtsingle_queue_submit;
      43                 :          0 :   pt->end = mtsingle_queue_end;
      44                 :          0 :   pt->mt.worker = worker;
      45                 :          0 :   pt->mt.pending = NULL;
      46                 :          0 : }
      47                 :            : 
      48                 :            : void
      49                 :          0 : mt_queue_end(struct pari_mt *pt) { pt->end(); }
      50                 :            : 
      51                 :            : void
      52                 :          0 : mt_queue_submit(struct pari_mt *pt, long workid, GEN work)
      53                 :          0 : { pt->submit(&pt->mt, workid, work); }
      54                 :            : 
      55                 :            : GEN
      56                 :          0 : mt_queue_get(struct pari_mt *pt, long *workid, long *pending)
      57                 :          0 : { return pt->get(&pt->mt, workid, pending); }
      58                 :            : 
      59                 :            : 
      60                 :            : void
      61                 :     914911 : mtstate_save(long *pending)
      62                 :            : {
      63                 :     914911 :   *pending = mt_is_parallel();
      64                 :     914911 : }
      65                 :            : 
      66                 :            : void
      67                 :      12409 : mtstate_restore(long *pending)
      68                 :            : {
      69 [ +  - ][ -  + ]:      12409 :   if (!*pending && mt_is_parallel())
      70                 :          0 :     mt_queue_reset();
      71                 :      12409 : }
      72                 :            : 
      73                 :            : void
      74                 :         75 : mtstate_reset(void)
      75                 :            : {
      76         [ -  + ]:         75 :   if (mt_is_parallel())
      77                 :          0 :     mt_queue_reset();
      78                 :         75 : }

Generated by: LCOV version 1.9