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 30816-9c15a02229) Lines: 683 719 95.0 %
Date: 2026-04-15 09:25:30 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 200761
muluui 222991
divis 337094
convi 441869
pari_gmp_free 1763811
setloop 2999299
truncr 3454788
sqrtremi 5130500
xmpn_copy 6872472
floorr 6947035
diviuexact 34025890
red_montgomery 34502294
divri_with_gmp 35492294
remi2n 37863126
sqrispec_mirror 40078389
icopy_ef 42064221
absdiviu_rem 51861105
mpz2GEN 57927104
divrr_with_gmp 77887017
muliispec_mirror 83353060
incpos 87325120
incloop 87728134
divis_rem 94106887
GEN2mpz 115852149
sqrtr_abs 130438953
mantissa2nr 140967204
divrr 150323180
divri 152465860
xmpn_zero 243548154
equaliispec 307864285
int_normalize 310193086
affir 406288759
diviuexact_i 433499837
roundr_up_ip 535663013
diviiexact 553093019
xmpn_mirror 588898706
xmpn_mirrorcopy 725613462
shiftispec 739713391
adduispec_offset 765657761
sqrispec 1143149654
umodiu 1360994191
subiuspec 1822290221
dvmdii 2254249672
adduispec 2837079545
subiispec 3100987242
addiispec 3380289773
cmpiispec 4043257711
muluispec 5690652546
muliispec 5952672695

Generated by: LCOV version 1.16