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 30572-91e0396466) Lines: 688 719 95.7 %
Date: 2025-12-12 09:22:23 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 200468
muluui 222681
divis 325454
convi 439761
pari_gmp_free 1755988
setloop 2999294
truncr 3462128
sqrtremi 5162781
xmpn_copy 6897445
floorr 6947874
diviuexact 31839504
red_montgomery 34997781
divri_with_gmp 35251661
remi2n 39152294
sqrispec_mirror 40088593
icopy_ef 41508341
absdiviu_rem 51102694
mpz2GEN 57808164
divrr_with_gmp 76259113
muliispec_mirror 83339441
divis_rem 86377759
incpos 103134012
incloop 103534858
GEN2mpz 115614105
sqrtr_abs 126391557
mantissa2nr 138418773
divrr 142554136
divri 151545994
xmpn_zero 237630369
equaliispec 268870384
int_normalize 307150761
affir 404484542
diviuexact_i 413787833
roundr_up_ip 518777333
diviiexact 534657270
xmpn_mirror 584775451
xmpn_mirrorcopy 714134665
shiftispec 720331325
adduispec_offset 764464362
sqrispec 1030514069
umodiu 1328226754
subiuspec 1780310026
dvmdii 2198288225
adduispec 2789309371
subiispec 3024681920
addiispec 3338286141
cmpiispec 3982887896
muluispec 5607483144
muliispec 5846572230

Generated by: LCOV version 1.16