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
GEN2mpz 115528974
absdiviu_rem 51014115
addiispec 3336569276
adduispec 2790743831
adduispec_offset 764097560
addumului 0
affir 404252760
cmpiispec 3979961870
convi 439739
diviiexact 533905958
divis 325428
divis_rem 86236084
diviuexact 31837437
diviuexact_i 413214018
diviuuexact 200503
divri 151468817
divri_with_gmp 35251632
divrr 142529674
divrr_with_gmp 76240773
dvmdii 2196056702
equaliispec 268857394
floorr 6945451
icopy_ef 41492547
incloop 103536815
incneg 66684
incpos 103129686
int_normalize 307437067
mantissa2nr 138312256
mpz2GEN 57765702
muliispec 5838827211
muliispec_mirror 83256538
muluispec 5598279517
muluui 222731
pari_gmp_free 1755952
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 35023596
remi2n 39048076
resetloop 174328
roundr_up_ip 518410060
setloop 2999293
shiftispec 720085419
sqrispec 1030921379
sqrispec_mirror 40048223
sqrtr_abs 126367480
sqrtremi 5162219
subiispec 3023881033
subiuspec 1779118967
truncr 3456219
umodiu 1332036147
xmpn_copy 6897068
xmpn_mirror 584418355
xmpn_mirrorcopy 713753721
xmpn_zero 237563018

Generated by: LCOV version 1.16