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 30587-f85873d515) Lines: 683 719 95.0 %
Date: 2025-12-27 09:21:13 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 200491
muluui 222717
divis 323940
convi 439785
pari_gmp_free 1735794
setloop 2999292
truncr 3454011
sqrtremi 5159865
xmpn_copy 6832397
floorr 6944519
diviuexact 31783840
red_montgomery 34286848
divri_with_gmp 35251211
remi2n 37817650
sqrispec_mirror 40104188
icopy_ef 41489877
absdiviu_rem 51098268
mpz2GEN 57804346
divrr_with_gmp 76247488
muliispec_mirror 83398599
divis_rem 86370228
incpos 103256475
incloop 103660273
GEN2mpz 115606391
sqrtr_abs 126390033
mantissa2nr 138417312
divrr 142550874
divri 151539360
xmpn_zero 237650147
equaliispec 268806911
int_normalize 309117468
affir 404579639
diviuexact_i 413276610
roundr_up_ip 518686041
diviiexact 534205598
xmpn_mirror 585067406
shiftispec 714006254
xmpn_mirrorcopy 714551718
adduispec_offset 765021216
sqrispec 1025514531
umodiu 1329112505
subiuspec 1780508950
dvmdii 2193567594
adduispec 2789207286
subiispec 3020819711
addiispec 3334697887
cmpiispec 3977657602
muluispec 5601471836
muliispec 5834738276

Generated by: LCOV version 1.16