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

Generated by: LCOV version 1.16