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
GEN2mpz 115601244
absdiviu_rem 51088751
addiispec 3334034334
adduispec 2789702252
adduispec_offset 764521177
addumului 0
affir 404396177
cmpiispec 3975642947
convi 439777
diviiexact 533987717
divis 323931
divis_rem 86335556
diviuexact 31783380
diviuexact_i 413072835
diviuuexact 200481
divri 151534595
divri_with_gmp 35251106
divrr 142521866
divrr_with_gmp 76235131
dvmdii 2192423117
equaliispec 268804255
floorr 6939130
icopy_ef 41484139
incloop 103682249
incneg 66684
incpos 103277915
int_normalize 309121133
mantissa2nr 138399862
mpz2GEN 57802023
muliispec 5835582902
muliispec_mirror 83362813
muluispec 5602744042
muluui 222699
pari_gmp_free 1735792
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34352950
remi2n 37740433
resetloop 174328
roundr_up_ip 518606426
setloop 2999293
shiftispec 713538251
sqrispec 1025075767
sqrispec_mirror 40096390
sqrtr_abs 126382392
sqrtremi 5159881
subiispec 3019389526
subiuspec 1779888358
truncr 3438149
umodiu 1330179742
xmpn_copy 6832562
xmpn_mirror 584835372
xmpn_mirrorcopy 714336707
xmpn_zero 237607636

Generated by: LCOV version 1.16