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 30586-ccf601f509) Lines: 683 719 95.0 %
Date: 2025-12-26 09:21:14 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 200451
muluui 222687
divis 323937
convi 439785
pari_gmp_free 1735795
setloop 2999293
truncr 3460885
sqrtremi 5159833
xmpn_copy 6832700
floorr 6947196
diviuexact 31780980
red_montgomery 34267159
divri_with_gmp 35250802
remi2n 37789257
sqrispec_mirror 40096022
icopy_ef 41492210
absdiviu_rem 51084639
mpz2GEN 57805851
divrr_with_gmp 76256178
muliispec_mirror 83333504
divis_rem 86367124
incpos 103463721
incloop 103867330
GEN2mpz 115608935
sqrtr_abs 126385237
mantissa2nr 138407662
divrr 142552886
divri 151541429
xmpn_zero 237631283
equaliispec 268814200
int_normalize 308992807
affir 404459891
diviuexact_i 413132392
roundr_up_ip 518673360
diviiexact 534068877
xmpn_mirror 584849741
shiftispec 713420887
xmpn_mirrorcopy 714294796
adduispec_offset 764912503
sqrispec 1024455130
umodiu 1330139565
subiuspec 1780263110
dvmdii 2192051554
adduispec 2790022656
subiispec 3019153557
addiispec 3333633259
cmpiispec 3975862759
muluispec 5597440798
muliispec 5829904319

Generated by: LCOV version 1.16