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 - kernel/gmp - mp.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30425-4669acb345) Lines: 683 719 95.0 %
Date: 2025-08-01 09:23:42 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addumului 0
pari_gmp_realloc 0
pari_kernel_version 4
pari_kernel_close 1104
pari_kernel_init 1112
incneg 66684
resetloop 174328
diviuuexact 200507
muluui 222719
convi 438990
divis 1006072
pari_gmp_free 1755947
setloop 2999278
truncr 3632521
sqrtremi 5160726
xmpn_copy 6889977
floorr 7130438
red_montgomery 35046678
divri_with_gmp 35250215
remi2n 38958329
diviuexact 40545187
sqrispec_mirror 41411101
icopy_ef 41473668
mpz2GEN 57740820
divrr_with_gmp 76136956
muliispec_mirror 85044953
divis_rem 86202190
incpos 101473536
incloop 101874506
absdiviu_rem 113209492
GEN2mpz 115478530
sqrtr_abs 126376010
mantissa2nr 138190044
divrr 142753765
divri 151398693
xmpn_zero 237540271
equaliispec 269627983
int_normalize 305966244
affir 403847591
diviuexact_i 422441962
roundr_up_ip 527379748
diviiexact 534435304
xmpn_mirror 587202831
shiftispec 717843888
xmpn_mirrorcopy 718726494
adduispec_offset 764236513
sqrispec 1030730844
umodiu 1328295991
subiuspec 1777187550
dvmdii 2195309929
adduispec 2785576310
subiispec 3020043089
addiispec 3334114446
cmpiispec 3978545324
muluispec 5612176830
muliispec 5942583098

Generated by: LCOV version 1.16