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 30561-4f4869c0e7) Lines: 683 719 95.0 %
Date: 2025-11-28 09:21:39 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115523644
absdiviu_rem 51000153
addiispec 3337711742
adduispec 2788577948
adduispec_offset 764773937
addumului 0
affir 404217985
cmpiispec 3981650648
convi 439745
diviiexact 534113443
divis 325426
divis_rem 86236345
diviuexact 31839335
diviuexact_i 413433729
diviuuexact 200469
divri 151466336
divri_with_gmp 35250672
divrr 142528952
divrr_with_gmp 76240284
dvmdii 2196905017
equaliispec 268861927
floorr 6947554
icopy_ef 41492941
incloop 103709338
incneg 66684
incpos 103308859
int_normalize 306777217
mantissa2nr 138314824
mpz2GEN 57762935
muliispec 5843246848
muliispec_mirror 83347071
muluispec 5603880795
muluui 222698
pari_gmp_free 1755955
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34965095
remi2n 39031687
resetloop 174328
roundr_up_ip 518584420
setloop 2999295
shiftispec 720414521
sqrispec 1030986420
sqrispec_mirror 40049116
sqrtr_abs 126368138
sqrtremi 5162263
subiispec 3024452705
subiuspec 1779271406
truncr 3460160
umodiu 1327420102
xmpn_copy 6897299
xmpn_mirror 584486327
xmpn_mirrorcopy 713865973
xmpn_zero 237577766

Generated by: LCOV version 1.16