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
GEN2mpz 115606391
absdiviu_rem 51098268
addiispec 3334697887
adduispec 2789207286
adduispec_offset 765021216
addumului 0
affir 404579639
cmpiispec 3977657602
convi 439785
diviiexact 534205598
divis 323940
divis_rem 86370228
diviuexact 31783840
diviuexact_i 413276610
diviuuexact 200491
divri 151539360
divri_with_gmp 35251211
divrr 142550874
divrr_with_gmp 76247488
dvmdii 2193567594
equaliispec 268806911
floorr 6944519
icopy_ef 41489877
incloop 103660273
incneg 66684
incpos 103256475
int_normalize 309117468
mantissa2nr 138417312
mpz2GEN 57804346
muliispec 5834738276
muliispec_mirror 83398599
muluispec 5601471836
muluui 222717
pari_gmp_free 1735794
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34286848
remi2n 37817650
resetloop 174328
roundr_up_ip 518686041
setloop 2999292
shiftispec 714006254
sqrispec 1025514531
sqrispec_mirror 40104188
sqrtr_abs 126390033
sqrtremi 5159865
subiispec 3020819711
subiuspec 1780508950
truncr 3454011
umodiu 1329112505
xmpn_copy 6832397
xmpn_mirror 585067406
xmpn_mirrorcopy 714551718
xmpn_zero 237650147

Generated by: LCOV version 1.16