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

Function Name Sort by function name Hit count Sort by function hit count
addumului 0
pari_gmp_realloc 0
pari_kernel_version 4
pari_kernel_close 1092
pari_kernel_init 1100
incneg 66684
resetloop 174380
diviuuexact 200898
muluui 223122
divis 336637
convi 447819
pari_gmp_free 1632823
truncr 2530528
setloop 2999288
sqrtremi 5137728
floorr 6429988
xmpn_copy 7066592
diviuexact 34276553
red_montgomery 34721677
divri_with_gmp 35425877
remi2n 38658518
sqrispec_mirror 42195860
icopy_ef 42973936
absdiviu_rem 52881048
mpz2GEN 58507346
incpos 64028174
incloop 64431510
divrr_with_gmp 78685886
muliispec_mirror 86836601
divis_rem 94395633
GEN2mpz 117014692
sqrtr_abs 131576064
mantissa2nr 142737059
divrr 151753587
divri 161201476
xmpn_zero 245687827
equaliispec 310392376
int_normalize 322927218
affir 422159452
diviuexact_i 441894600
diviiexact 561434863
roundr_up_ip 562370049
xmpn_mirror 609310613
xmpn_mirrorcopy 742280633
shiftispec 763922087
adduispec_offset 775350647
sqrispec 1082975114
umodiu 1373640145
subiuspec 1873899109
dvmdii 2315293826
adduispec 2910157575
subiispec 3277554031
addiispec 3497928025
cmpiispec 4256804104
muluispec 5943077229
muliispec 6213002227

Generated by: LCOV version 2.0-1