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 30565-738e569de9) Lines: 683 719 95.0 %
Date: 2025-11-30 09:23:42 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 200503
muluui 222731
divis 325428
convi 439739
pari_gmp_free 1755952
setloop 2999293
truncr 3456219
sqrtremi 5162219
xmpn_copy 6897068
floorr 6945451
diviuexact 31837437
red_montgomery 35023596
divri_with_gmp 35251632
remi2n 39048076
sqrispec_mirror 40048223
icopy_ef 41492547
absdiviu_rem 51014115
mpz2GEN 57765702
divrr_with_gmp 76240773
muliispec_mirror 83256538
divis_rem 86236084
incpos 103129686
incloop 103536815
GEN2mpz 115528974
sqrtr_abs 126367480
mantissa2nr 138312256
divrr 142529674
divri 151468817
xmpn_zero 237563018
equaliispec 268857394
int_normalize 307437067
affir 404252760
diviuexact_i 413214018
roundr_up_ip 518410060
diviiexact 533905958
xmpn_mirror 584418355
xmpn_mirrorcopy 713753721
shiftispec 720085419
adduispec_offset 764097560
sqrispec 1030921379
umodiu 1332036147
subiuspec 1779118967
dvmdii 2196056702
adduispec 2790743831
subiispec 3023881033
addiispec 3336569276
cmpiispec 3979961870
muluispec 5598279517
muliispec 5838827211

Generated by: LCOV version 1.16