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 30759-17b423fb9b) Lines: 683 719 95.0 %
Date: 2026-03-20 09:26:27 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 200879
muluui 223104
divis 337094
convi 441344
pari_gmp_free 1763210
setloop 2999287
truncr 3448713
sqrtremi 5130345
xmpn_copy 6872354
floorr 6942848
diviuexact 34108827
red_montgomery 34516449
divri_with_gmp 35490128
remi2n 38000040
sqrispec_mirror 40114601
icopy_ef 42000555
absdiviu_rem 51839706
mpz2GEN 57909063
divrr_with_gmp 77864588
muliispec_mirror 83257234
incpos 87338878
incloop 87741738
divis_rem 94099360
GEN2mpz 115816109
sqrtr_abs 130321755
mantissa2nr 140927380
divrr 150236658
divri 152457552
xmpn_zero 243518215
equaliispec 267331990
int_normalize 309044074
affir 406678671
diviuexact_i 432592265
roundr_up_ip 535953839
diviiexact 552058761
xmpn_mirror 589488821
xmpn_mirrorcopy 726055193
shiftispec 740550798
adduispec_offset 765663684
sqrispec 1143377243
umodiu 1360735367
subiuspec 1823037495
dvmdii 2254341186
adduispec 2836578984
subiispec 3100693521
addiispec 3380764390
cmpiispec 4043306008
muluispec 5698637091
muliispec 5958040283

Generated by: LCOV version 1.16