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 30802-b11b770002) Lines: 683 719 95.0 %
Date: 2026-04-12 09:26:48 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 1088
pari_kernel_init 1096
incneg 66684
resetloop 174328
diviuuexact 200790
muluui 223018
divis 337097
convi 441869
pari_gmp_free 1763205
setloop 2999292
truncr 3431364
sqrtremi 5130305
xmpn_copy 6872334
floorr 6936994
diviuexact 34102963
red_montgomery 34568698
divri_with_gmp 35491827
remi2n 37897772
sqrispec_mirror 40089751
icopy_ef 41991902
absdiviu_rem 51849328
mpz2GEN 57905476
divrr_with_gmp 77850614
muliispec_mirror 83121072
incpos 87316761
incloop 87718621
divis_rem 94079236
GEN2mpz 115808869
sqrtr_abs 130322010
mantissa2nr 140892801
divrr 150199528
divri 152453104
xmpn_zero 243445686
equaliispec 307807246
int_normalize 310390224
affir 406101413
diviuexact_i 433231908
roundr_up_ip 535623709
diviiexact 552733259
xmpn_mirror 588517337
xmpn_mirrorcopy 725239916
shiftispec 739401212
adduispec_offset 764911188
sqrispec 1142116428
umodiu 1363124675
subiuspec 1821977039
dvmdii 2253668669
adduispec 2836248797
subiispec 3098224415
addiispec 3378617568
cmpiispec 4039773637
muluispec 5687707272
muliispec 5948903615

Generated by: LCOV version 1.16