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 30604-e5d817ee12) Lines: 683 719 95.0 %
Date: 2026-01-09 09:21:43 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115540319
absdiviu_rem 51265891
addiispec 3332408299
adduispec 2788092055
adduispec_offset 764904018
addumului 0
affir 404984708
cmpiispec 3974351047
convi 439781
diviiexact 534485840
divis 323926
divis_rem 86362996
diviuexact 31783395
diviuexact_i 413614544
diviuuexact 200465
divri 151788091
divri_with_gmp 35477413
divrr 142514908
divrr_with_gmp 76235817
dvmdii 2191365406
equaliispec 267839944
floorr 6942339
icopy_ef 41520961
incloop 103841965
incneg 66684
incpos 103429791
int_normalize 308563790
mantissa2nr 138649281
mpz2GEN 57771254
muliispec 5837358763
muliispec_mirror 83216975
muluispec 5605526535
muluui 222694
pari_gmp_free 1762881
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34346440
remi2n 37945197
resetloop 174328
roundr_up_ip 518912344
setloop 2999294
shiftispec 713969474
sqrispec 1023578196
sqrispec_mirror 40091351
sqrtr_abs 126372328
sqrtremi 5128724
subiispec 3016453041
subiuspec 1778715758
truncr 3448390
umodiu 1329094209
xmpn_copy 6836092
xmpn_mirror 585436224
xmpn_mirrorcopy 714976132
xmpn_zero 237895263

Generated by: LCOV version 1.16