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 30610-dfc8ed42cd) Lines: 683 719 95.0 %
Date: 2026-01-14 09:22:13 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 200496
muluui 222718
divis 323942
convi 439793
pari_gmp_free 1762896
setloop 2999293
truncr 3437119
sqrtremi 5128710
xmpn_copy 6836247
floorr 6939269
diviuexact 31784116
red_montgomery 34340047
divri_with_gmp 35477676
remi2n 38014900
sqrispec_mirror 40102424
icopy_ef 41517111
absdiviu_rem 51263630
mpz2GEN 57771088
divrr_with_gmp 76223782
muliispec_mirror 83243161
divis_rem 86343778
incpos 103409745
incloop 103813581
GEN2mpz 115539920
sqrtr_abs 126367445
mantissa2nr 138641049
divrr 142500794
divri 151785184
xmpn_zero 237859960
equaliispec 267834475
int_normalize 308460440
affir 405026026
diviuexact_i 413522151
roundr_up_ip 518873529
diviiexact 534401647
xmpn_mirror 585392085
shiftispec 713985772
xmpn_mirrorcopy 714962776
adduispec_offset 764841885
sqrispec 1023800585
umodiu 1330223821
subiuspec 1778302433
dvmdii 2192243952
adduispec 2788145217
subiispec 3016458139
addiispec 3332172973
cmpiispec 3974029003
muluispec 5603606988
muliispec 5835005000

Generated by: LCOV version 1.16