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 30364-8108102770) Lines: 688 719 95.7 %
Date: 2025-06-30 09:21:07 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115236929
absdiviu_rem 110609286
addiispec 3331408953
adduispec 2787413426
adduispec_offset 765797190
addumului 0
affir 403528271
cmpiispec 3968438027
convi 438665
diviiexact 532413285
divis 976967
divis_rem 86206607
diviuexact 39353232
diviuexact_i 419788567
diviuuexact 200448
divri 151203465
divri_with_gmp 35238477
divrr 142468319
divrr_with_gmp 76053085
dvmdii 2192970364
equaliispec 268791857
floorr 7138767
icopy_ef 41209368
incloop 103669172
incneg 66684
incpos 103266980
int_normalize 308178270
mantissa2nr 138190167
mpz2GEN 57619648
muliispec 5945001585
muliispec_mirror 85190150
muluispec 5606087232
muluui 222661
pari_gmp_free 1755948
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34909433
remi2n 38938837
resetloop 174328
roundr_up_ip 526864812
setloop 2997874
shiftispec 714295333
sqrispec 1025613558
sqrispec_mirror 41394760
sqrtr_abs 126365986
sqrtremi 5164409
subiispec 3016136017
subiuspec 1775423372
truncr 3652440
umodiu 1313705908
xmpn_copy 6887576
xmpn_mirror 586913134
xmpn_mirrorcopy 718282392
xmpn_zero 237369444

Generated by: LCOV version 1.16