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 30838-aa3635ec72) Lines: 683 719 95.0 %
Date: 2026-04-28 09:25:50 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 1092
pari_kernel_init 1100
incneg 66684
resetloop 174328
diviuuexact 200758
muluui 222984
divis 336677
convi 441885
pari_gmp_free 1763836
setloop 2999296
truncr 3447332
sqrtremi 5130330
xmpn_copy 6872397
floorr 6943408
diviuexact 34022586
red_montgomery 34389588
divri_with_gmp 35494605
remi2n 37925068
sqrispec_mirror 40078555
icopy_ef 42058734
absdiviu_rem 51843274
mpz2GEN 57932255
divrr_with_gmp 77909665
muliispec_mirror 83228007
incpos 87046933
incloop 87449001
divis_rem 94078104
GEN2mpz 115861712
sqrtr_abs 130487847
mantissa2nr 140990005
divrr 150346292
divri 152472469
xmpn_zero 243613171
equaliispec 307854673
int_normalize 310492437
affir 406209475
diviuexact_i 433333339
roundr_up_ip 535435267
diviiexact 552918090
xmpn_mirror 588751743
xmpn_mirrorcopy 725609875
shiftispec 739335895
adduispec_offset 765372920
sqrispec 1142602796
umodiu 1359101106
subiuspec 1822220102
dvmdii 2252736552
adduispec 2833401232
subiispec 3099393867
addiispec 3378558795
cmpiispec 4040302556
muluispec 5677200309
muliispec 5939454052

Generated by: LCOV version 1.16