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 30574-595e4ba651) Lines: 683 719 95.0 %
Date: 2025-12-18 09:22:54 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 200498
muluui 222718
divis 325453
convi 439782
pari_gmp_free 1755996
setloop 2999294
truncr 3455708
sqrtremi 5162771
xmpn_copy 6897525
floorr 6945803
diviuexact 31842091
red_montgomery 34937868
divri_with_gmp 35252032
remi2n 39237242
sqrispec_mirror 40097445
icopy_ef 41505497
absdiviu_rem 51103754
mpz2GEN 57809230
divrr_with_gmp 76253795
muliispec_mirror 83426406
divis_rem 86373592
incpos 103316448
incloop 103715291
GEN2mpz 115616216
sqrtr_abs 126399704
mantissa2nr 138432088
divrr 142557565
divri 151545115
xmpn_zero 237648844
equaliispec 268870433
int_normalize 307298631
affir 404690655
diviuexact_i 413930809
roundr_up_ip 518885184
diviiexact 534814534
xmpn_mirror 585181012
xmpn_mirrorcopy 714554412
shiftispec 720804897
adduispec_offset 764901901
sqrispec 1031509330
umodiu 1327489753
subiuspec 1780639286
dvmdii 2199760036
adduispec 2789091339
subiispec 3026542050
addiispec 3339304649
cmpiispec 3985672832
muluispec 5608549767
muliispec 5847696149

Generated by: LCOV version 1.16