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 30572-91e0396466) Lines: 688 719 95.7 %
Date: 2025-12-14 09:22:17 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115619396
absdiviu_rem 51102662
addiispec 3338434009
adduispec 2791463943
adduispec_offset 764778226
addumului 0
affir 404531439
cmpiispec 3983491185
convi 439762
diviiexact 534728605
divis 325453
divis_rem 86368893
diviuexact 31840105
diviuexact_i 413842671
diviuuexact 200523
divri 151544273
divri_with_gmp 35250856
divrr 142556515
divrr_with_gmp 76255211
dvmdii 2198544334
equaliispec 268871829
floorr 6949081
icopy_ef 41506860
incloop 103709008
incneg 66684
incpos 103308667
int_normalize 307144871
mantissa2nr 138425615
mpz2GEN 57810897
muliispec 5847179842
muliispec_mirror 83363659
muluispec 5608439662
muluui 222741
pari_gmp_free 1755986
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34991011
remi2n 39196773
resetloop 174328
roundr_up_ip 518789118
setloop 2999292
shiftispec 720389881
sqrispec 1030444091
sqrispec_mirror 40091096
sqrtr_abs 126398127
sqrtremi 5162767
subiispec 3024931591
subiuspec 1780553311
truncr 3460533
umodiu 1329846477
xmpn_copy 6897300
xmpn_mirror 584879550
xmpn_mirrorcopy 714237557
xmpn_zero 237647395

Generated by: LCOV version 1.16