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 30480-572da319a6) Lines: 683 719 95.0 %
Date: 2025-08-22 09:24:07 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115524902
absdiviu_rem 50853429
addiispec 3336584117
adduispec 2788285624
adduispec_offset 764535993
addumului 0
affir 404139982
cmpiispec 3979814860
convi 439350
diviiexact 533825269
divis 325465
divis_rem 86244068
diviuexact 31840374
diviuexact_i 413118253
diviuuexact 200472
divri 151453647
divri_with_gmp 35250609
divrr 142807745
divrr_with_gmp 76344190
dvmdii 2195939437
equaliispec 269630759
floorr 7132992
icopy_ef 41476355
incloop 103804933
incneg 66684
incpos 103401610
int_normalize 306546762
mantissa2nr 138401227
mpz2GEN 57763761
muliispec 5842364337
muliispec_mirror 85113826
muluispec 5601085254
muluui 222706
pari_gmp_free 1755952
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34989301
remi2n 39114993
resetloop 174328
roundr_up_ip 527463941
setloop 2999287
shiftispec 720066169
sqrispec 1031421448
sqrispec_mirror 41401195
sqrtr_abs 126560378
sqrtremi 5160709
subiispec 3022771357
subiuspec 1778878250
truncr 3645093
umodiu 1328948571
xmpn_copy 6896455
xmpn_mirror 587840563
xmpn_mirrorcopy 719595445
xmpn_zero 237914311

Generated by: LCOV version 1.16