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 30604-e5d817ee12) Lines: 1115 1153 96.7 %
Date: 2026-01-08 09:21:40 Functions: 69 70 98.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Zf_add 188060544
Zf_mul 15366912
Zf_mulsqrt2 188060544
Zf_red_destroy 400169784
Zf_shift 206723421
Zf_sqr 456960
Zf_sub 191483742
absdiviu_rem 234809529
addiispec 4596856221
addshiftw 709855914
adduispec 2399213559
adduispec_offset 491095203
addumului 0
affir 323919633
catii 474644244
cmpiispec 4133233986
convi 317935
convi_dac 737718
diviiexact 397185030
divis 239013
divis_rem 65918388
diviuexact 22390545
diviuexact_i 29671608
diviuuexact 149898
divri 114498621
divrr 130286850
dvmdii 1685500008
equaliispec 199021365
floorr 5204907
incloop 35267175
incneg 50013
incpos 34964676
int_normalize 857220387
mantissa2nr 49393251
muliifft_dis 15738408
muliifft_dit 31021560
muliifft_spliti 169224
muliifft_unspliti 85464
muliispec 5399516595
muliispec_basecase 5171377023
muliispec_fft 83760
mulliifft_params 85464
muluispec 4858203195
muluui 166566
p_sqrtu1 95531907
p_sqrtu2 92821248
pari_kernel_close 786
pari_kernel_init 788
pari_kernel_version 2
red_montgomery 36216201
remi2n 20312808
resetloop 130656
roundr_up_ip 442624270
setloop 2248395
shiftispec 1288677855
sqrispec 946369554
sqrispec_basecase 936387429
sqrispec_fft 1704
sqrtispec 329872098
sqrtispec1_sh 2710659
sqrtispec2 92549976
sqrtispec2_sh 271272
sqrtr_abs 91763916
sqrtremi 3768546
subiispec 3402637725
subiuspec 1597416273
truncr 2555445
umodiu 1432466847
xmpn_copy 1082151561
xmpn_zero 91763916

Generated by: LCOV version 1.16