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 30657-d14c2a9e4e) Lines: 683 719 95.0 %
Date: 2026-01-30 09:23:18 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 222709
divis 323925
convi 439862
pari_gmp_free 1763110
setloop 2999293
truncr 3460301
sqrtremi 5128833
xmpn_copy 6836470
floorr 6946518
diviuexact 31782958
red_montgomery 34383630
divri_with_gmp 35478820
remi2n 37982402
sqrispec_mirror 40103052
icopy_ef 41526437
absdiviu_rem 51276339
mpz2GEN 57771474
divrr_with_gmp 76252006
muliispec_mirror 83416663
divis_rem 86376240
incpos 103389536
incloop 103798236
GEN2mpz 115540836
sqrtr_abs 126384577
mantissa2nr 138672532
divrr 142560987
divri 151795484
xmpn_zero 237926137
equaliispec 267844665
int_normalize 308665099
affir 405359091
diviuexact_i 413619768
roundr_up_ip 519427111
diviiexact 534513512
xmpn_mirror 586182900
shiftispec 714394891
xmpn_mirrorcopy 715413077
adduispec_offset 765457381
sqrispec 1024550392
umodiu 1329277728
subiuspec 1775991881
dvmdii 2194492546
adduispec 2787363507
subiispec 3012688015
addiispec 3331622059
cmpiispec 3970090869
muluispec 5602127463
muliispec 5832627216

Generated by: LCOV version 1.16