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
GEN2mpz 115608935
absdiviu_rem 51084639
addiispec 3333633259
adduispec 2790022656
adduispec_offset 764912503
addumului 0
affir 404459891
cmpiispec 3975862759
convi 439785
diviiexact 534068877
divis 323937
divis_rem 86367124
diviuexact 31780980
diviuexact_i 413132392
diviuuexact 200451
divri 151541429
divri_with_gmp 35250802
divrr 142552886
divrr_with_gmp 76256178
dvmdii 2192051554
equaliispec 268814200
floorr 6947196
icopy_ef 41492210
incloop 103867330
incneg 66684
incpos 103463721
int_normalize 308992807
mantissa2nr 138407662
mpz2GEN 57805851
muliispec 5829904319
muliispec_mirror 83333504
muluispec 5597440798
muluui 222687
pari_gmp_free 1735795
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34267159
remi2n 37789257
resetloop 174328
roundr_up_ip 518673360
setloop 2999293
shiftispec 713420887
sqrispec 1024455130
sqrispec_mirror 40096022
sqrtr_abs 126385237
sqrtremi 5159833
subiispec 3019153557
subiuspec 1780263110
truncr 3460885
umodiu 1330139565
xmpn_copy 6832700
xmpn_mirror 584849741
xmpn_mirrorcopy 714294796
xmpn_zero 237631283

Generated by: LCOV version 1.16