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 30571-c0dfe82732) Lines: 683 719 95.0 %
Date: 2025-12-06 09:22:10 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 200478
muluui 222708
divis 325452
convi 439756
pari_gmp_free 1755993
setloop 2999295
truncr 3452931
sqrtremi 5162681
xmpn_copy 6897194
floorr 6944329
diviuexact 31839413
red_montgomery 34996935
divri_with_gmp 35251252
remi2n 39246236
sqrispec_mirror 40087081
icopy_ef 41503327
absdiviu_rem 51105073
mpz2GEN 57807348
divrr_with_gmp 76246156
muliispec_mirror 83335757
divis_rem 86360129
incpos 103278024
incloop 103680038
GEN2mpz 115611883
sqrtr_abs 126385208
mantissa2nr 138405759
divrr 142534119
divri 151543446
xmpn_zero 237606176
equaliispec 268868841
int_normalize 307294815
affir 404426770
diviuexact_i 413862908
roundr_up_ip 518728133
diviiexact 534732773
xmpn_mirror 584721878
xmpn_mirrorcopy 714057113
shiftispec 720442219
adduispec_offset 764667099
sqrispec 1030547255
umodiu 1328539956
subiuspec 1780494038
dvmdii 2198414341
adduispec 2789858704
subiispec 3024987253
addiispec 3338475433
cmpiispec 3983450042
muluispec 5606775734
muliispec 5845605749

Generated by: LCOV version 1.16