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) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31092-e6893b0017) Lines: 95.0 % 718 682
Test Date: 2026-08-15 17:02:54 Functions: 96.4 % 56 54
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
GEN2mpz 117017388
absdiviu_rem 52876745
addiispec 3497434939
adduispec 2911314421
adduispec_offset 775295111
addumului 0
affir 422103701
cmpiispec 4255274101
convi 447822
diviiexact 561402952
divis 336639
divis_rem 94361538
diviuexact 34276949
diviuexact_i 441863798
diviuuexact 200898
divri 161193808
divri_with_gmp 35425159
divrr 151744513
divrr_with_gmp 78683434
dvmdii 2314303363
equaliispec 310386114
floorr 6430007
icopy_ef 42965202
incloop 64373559
incneg 66684
incpos 63970222
int_normalize 322942234
mantissa2nr 142716382
mpz2GEN 58508694
muliispec 6212389969
muliispec_mirror 86836573
muluispec 5942473420
muluui 223122
pari_gmp_free 1632817
pari_gmp_realloc 0
pari_kernel_close 1092
pari_kernel_init 1100
pari_kernel_version 4
red_montgomery 34734569
remi2n 38638304
resetloop 174380
roundr_up_ip 562333624
setloop 2999288
shiftispec 763769108
sqrispec 1082485134
sqrispec_mirror 42195542
sqrtr_abs 131568714
sqrtremi 5137723
subiispec 3276548452
subiuspec 1873778987
truncr 2530551
umodiu 1374927099
xmpn_copy 7066506
xmpn_mirror 609222911
xmpn_mirrorcopy 742248850
xmpn_zero 245677307

Generated by: LCOV version 2.0-1