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 30634-7c77b4d1a9) Lines: 683 719 95.0 %
Date: 2026-01-26 09:23:16 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 200474
muluui 222681
divis 323926
convi 439855
pari_gmp_free 1763110
setloop 2999293
truncr 3462898
sqrtremi 5128714
xmpn_copy 6836267
floorr 6946636
diviuexact 31783013
red_montgomery 34329597
divri_with_gmp 35477478
remi2n 38019447
sqrispec_mirror 40091423
icopy_ef 41526453
absdiviu_rem 51262211
mpz2GEN 57773577
divrr_with_gmp 76249578
muliispec_mirror 83265040
divis_rem 86386546
incpos 102908982
incloop 103316127
GEN2mpz 115544475
sqrtr_abs 126366919
mantissa2nr 138641777
divrr 142546201
divri 151792597
xmpn_zero 237868295
equaliispec 267837901
int_normalize 308859305
affir 405130944
diviuexact_i 413551703
roundr_up_ip 519046549
diviiexact 534453258
xmpn_mirror 585585509
shiftispec 713955265
xmpn_mirrorcopy 714967959
adduispec_offset 764650824
sqrispec 1023883028
umodiu 1331957865
subiuspec 1775298027
dvmdii 2192258464
adduispec 2788191531
subiispec 3010370646
addiispec 3329680941
cmpiispec 3967205038
muluispec 5593820005
muliispec 5824254992

Generated by: LCOV version 1.16