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 30631-5f55634266) Lines: 683 719 95.0 %
Date: 2026-01-24 09:23:06 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 200525
muluui 222762
divis 323945
convi 439863
pari_gmp_free 1762889
setloop 2999291
truncr 3464776
sqrtremi 5128844
xmpn_copy 6836535
floorr 6948166
diviuexact 31784932
red_montgomery 34299170
divri_with_gmp 35478938
remi2n 38058959
sqrispec_mirror 40096868
icopy_ef 41530618
absdiviu_rem 51273862
mpz2GEN 57774961
divrr_with_gmp 76254661
muliispec_mirror 83314439
divis_rem 86388211
incpos 102931777
incloop 103340500
GEN2mpz 115547966
sqrtr_abs 126378487
mantissa2nr 138668826
divrr 142557800
divri 151796102
xmpn_zero 237915999
equaliispec 267844427
int_normalize 309140236
affir 405372070
diviuexact_i 413685202
roundr_up_ip 519275775
diviiexact 534591212
xmpn_mirror 585979285
shiftispec 714257083
xmpn_mirrorcopy 715256771
adduispec_offset 765254214
sqrispec 1023851262
umodiu 1329258248
subiuspec 1775600582
dvmdii 2192625274
adduispec 2786582857
subiispec 3011636005
addiispec 3330322263
cmpiispec 3968808877
muluispec 5595354966
muliispec 5826232165

Generated by: LCOV version 1.16