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

Generated by: LCOV version 1.16