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 30835-e55edf4b45) Lines: 683 719 95.0 %
Date: 2026-04-25 09:26:46 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 1092
pari_kernel_init 1100
incneg 66684
resetloop 174328
diviuuexact 200740
muluui 222991
divis 337102
convi 441881
pari_gmp_free 1763802
setloop 2999298
truncr 3429567
sqrtremi 5130432
xmpn_copy 6873549
floorr 6938714
diviuexact 34027129
red_montgomery 34557258
divri_with_gmp 35496174
remi2n 37900767
sqrispec_mirror 40093845
icopy_ef 42054953
absdiviu_rem 51854475
mpz2GEN 57928753
divrr_with_gmp 77894961
muliispec_mirror 83204533
incpos 87334564
incloop 87733777
divis_rem 94065674
GEN2mpz 115854461
sqrtr_abs 130493287
mantissa2nr 140991519
divrr 150327555
divri 152469330
xmpn_zero 243607259
equaliispec 307855669
int_normalize 310674543
affir 406241920
diviuexact_i 433376665
roundr_up_ip 535518328
diviiexact 552945400
xmpn_mirror 588739495
xmpn_mirrorcopy 725607612
shiftispec 739445172
adduispec_offset 765732112
sqrispec 1142832562
umodiu 1360433712
subiuspec 1822366234
dvmdii 2253809799
adduispec 2834981824
subiispec 3099634401
addiispec 3379562265
cmpiispec 4041111450
muluispec 5687490642
muliispec 5949892115

Generated by: LCOV version 1.16