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 30590-f14e077362) Lines: 683 719 95.0 %
Date: 2026-01-02 09:20:44 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 200481
muluui 222699
divis 323931
convi 439777
pari_gmp_free 1735792
setloop 2999293
truncr 3438149
sqrtremi 5159881
xmpn_copy 6832562
floorr 6939130
diviuexact 31783380
red_montgomery 34352950
divri_with_gmp 35251106
remi2n 37740433
sqrispec_mirror 40096390
icopy_ef 41484139
absdiviu_rem 51088751
mpz2GEN 57802023
divrr_with_gmp 76235131
muliispec_mirror 83362813
divis_rem 86335556
incpos 103277915
incloop 103682249
GEN2mpz 115601244
sqrtr_abs 126382392
mantissa2nr 138399862
divrr 142521866
divri 151534595
xmpn_zero 237607636
equaliispec 268804255
int_normalize 309121133
affir 404396177
diviuexact_i 413072835
roundr_up_ip 518606426
diviiexact 533987717
xmpn_mirror 584835372
shiftispec 713538251
xmpn_mirrorcopy 714336707
adduispec_offset 764521177
sqrispec 1025075767
umodiu 1330179742
subiuspec 1779888358
dvmdii 2192423117
adduispec 2789702252
subiispec 3019389526
addiispec 3334034334
cmpiispec 3975642947
muluispec 5602744042
muliispec 5835582902

Generated by: LCOV version 1.16