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-24 09:20:59 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 200471
muluui 222700
divis 323941
convi 439786
pari_gmp_free 1735797
setloop 2999293
truncr 3464021
sqrtremi 5159858
xmpn_copy 6832736
floorr 6947803
diviuexact 31784455
red_montgomery 34344795
divri_with_gmp 35250899
remi2n 37781025
sqrispec_mirror 40105587
icopy_ef 41495962
absdiviu_rem 51089700
mpz2GEN 57808296
divrr_with_gmp 76257387
muliispec_mirror 83309768
divis_rem 86377129
incpos 103496272
incloop 103900738
GEN2mpz 115614134
sqrtr_abs 126390427
mantissa2nr 138415505
divrr 142559967
divri 151540286
xmpn_zero 237647393
equaliispec 268816726
int_normalize 309051470
affir 404485409
diviuexact_i 413233979
roundr_up_ip 518726239
diviiexact 534153859
xmpn_mirror 584916855
shiftispec 713688704
xmpn_mirrorcopy 714364654
adduispec_offset 764858373
sqrispec 1024808131
umodiu 1330646315
subiuspec 1780408199
dvmdii 2192446644
adduispec 2790523828
subiispec 3019532276
addiispec 3334391052
cmpiispec 3976273958
muluispec 5604734501
muliispec 5837686632

Generated by: LCOV version 1.16