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

Generated by: LCOV version 1.16