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 30590-f14e077362) Lines: 683 719 95.0 %
Date: 2026-01-01 09:21:12 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115604890
absdiviu_rem 51093775
addiispec 3334247825
adduispec 2789408503
adduispec_offset 764694124
addumului 0
affir 404363776
cmpiispec 3975917837
convi 439775
diviiexact 534116335
divis 323943
divis_rem 86326881
diviuexact 31784693
diviuexact_i 413199272
diviuuexact 200450
divri 151533428
divri_with_gmp 35250960
divrr 142515461
divrr_with_gmp 76230672
dvmdii 2192837131
equaliispec 268805836
floorr 6938576
icopy_ef 41485628
incloop 103615861
incneg 66684
incpos 103212837
int_normalize 309199815
mantissa2nr 138399329
mpz2GEN 57803801
muliispec 5836951636
muliispec_mirror 83362372
muluispec 5603966675
muluui 222686
pari_gmp_free 1735791
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34408388
remi2n 37727214
resetloop 174328
roundr_up_ip 518619691
setloop 2999292
shiftispec 713669230
sqrispec 1025120945
sqrispec_mirror 40097596
sqrtr_abs 126380655
sqrtremi 5159928
subiispec 3019343821
subiuspec 1780033994
truncr 3433985
umodiu 1329851602
xmpn_copy 6832528
xmpn_mirror 584819398
xmpn_mirrorcopy 714327492
xmpn_zero 237608004

Generated by: LCOV version 1.16