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-09-21 17:02:41 Functions: 96.4 % 56 54
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
GEN2mpz 117018926
absdiviu_rem 52886988
addiispec 3497439393
adduispec 2910826284
adduispec_offset 775153386
addumului 0
affir 422126298
cmpiispec 4255252909
convi 447827
diviiexact 561348413
divis 336637
divis_rem 94363279
diviuexact 34275326
diviuexact_i 441808915
diviuuexact 200898
divri 161195578
divri_with_gmp 35425298
divrr 151743962
divrr_with_gmp 78683081
dvmdii 2314206078
equaliispec 310388335
floorr 6429901
icopy_ef 42967446
incloop 64323969
incneg 66684
incpos 63920631
int_normalize 322843885
mantissa2nr 142718829
mpz2GEN 58509463
muliispec 6212466321
muliispec_mirror 86836573
muluispec 5942565522
muluui 223122
pari_gmp_free 1632824
pari_gmp_realloc 0
pari_kernel_close 1092
pari_kernel_init 1100
pari_kernel_version 4
red_montgomery 34714741
remi2n 38566992
resetloop 174380
roundr_up_ip 562339847
setloop 2999288
shiftispec 763679663
sqrispec 1082472577
sqrispec_mirror 42195509
sqrtr_abs 131567642
sqrtremi 5137812
subiispec 3276574891
subiuspec 1873724048
truncr 2530451
umodiu 1374481756
xmpn_copy 7066358
xmpn_mirror 609238717
xmpn_mirrorcopy 742250913
xmpn_zero 245676021

Generated by: LCOV version 2.0-1