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/none - mp.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30586-ccf601f509) Lines: 1115 1153 96.7 %
Date: 2025-12-26 09:21:14 Functions: 69 70 98.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Zf_add 187658496
Zf_mul 15338496
Zf_mulsqrt2 187658496
Zf_red_destroy 399271821
Zf_shift 206264025
Zf_sqr 448896
Zf_sub 191070960
absdiviu_rem 234664092
addiispec 4589612625
addshiftw 707303190
adduispec 2400051492
adduispec_offset 491095203
addumului 0
affir 323217105
catii 474677484
cmpiispec 4131576090
convi 317935
convi_dac 737718
diviiexact 396932301
divis 239013
divis_rem 65909685
diviuexact 22392102
diviuexact_i 29689764
diviuuexact 149898
divri 114310044
divrr 130121835
dvmdii 1685248113
equaliispec 199751883
floorr 5203842
incloop 35267175
incneg 50013
incpos 34964676
int_normalize 856691010
mantissa2nr 49204713
muliifft_dis 15702102
muliifft_dit 30956967
muliifft_spliti 168921
muliifft_unspliti 85290
muliispec 5395397919
muliispec_basecase 5168519277
muliispec_fft 83631
mulliifft_params 85290
muluispec 4854788628
muluui 166566
p_sqrtu1 95559192
p_sqrtu2 92825157
pari_kernel_close 786
pari_kernel_init 788
pari_kernel_version 2
red_montgomery 36216201
remi2n 20103990
resetloop 130656
roundr_up_ip 442584013
setloop 2248395
shiftispec 1287411327
sqrispec 946292466
sqrispec_basecase 936352581
sqrispec_fft 1659
sqrtispec 329892642
sqrtispec1_sh 2734035
sqrtispec2 92553900
sqrtispec2_sh 271257
sqrtr_abs 91767876
sqrtremi 3791871
subiispec 3400373196
subiuspec 1598244612
truncr 2554281
umodiu 1432363512
xmpn_copy 1082221920
xmpn_zero 91767876

Generated by: LCOV version 1.16