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 30786-ffec283a2b) Lines: 1115 1153 96.7 %
Date: 2026-04-07 09:25:56 Functions: 69 70 98.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Zf_add 188395200
Zf_mul 15393408
Zf_mulsqrt2 188395200
Zf_red_destroy 400920264
Zf_shift 207111684
Zf_sqr 456960
Zf_sub 191832396
absdiviu_rem 234810189
addiispec 4591178292
addshiftw 715337961
adduispec 2393036112
adduispec_offset 491639820
addumului 0
affir 324810849
catii 484531578
cmpiispec 4127029965
convi 319424
convi_dac 738921
diviiexact 388119846
divis 245628
divis_rem 65910108
diviuexact 22392822
diviuexact_i 29659026
diviuuexact 150129
divri 114999012
divrr 136094145
dvmdii 1688793942
equaliispec 227406552
floorr 5201916
incloop 35267283
incneg 50013
incpos 34964784
int_normalize 868113129
mantissa2nr 49456956
muliifft_dis 15764802
muliifft_dit 31074348
muliifft_spliti 169428
muliifft_unspliti 85566
muliispec 5380917636
muliispec_basecase 5152507692
muliispec_fft 83862
mulliifft_params 85566
muluispec 4838670366
muluui 166797
p_sqrtu1 98510949
p_sqrtu2 95799198
pari_kernel_close 792
pari_kernel_init 794
pari_kernel_version 2
red_montgomery 36218184
remi2n 20286087
resetloop 130656
roundr_up_ip 449700046
setloop 2248401
shiftispec 1290559701
sqrispec 1005396471
sqrispec_basecase 995415168
sqrispec_fft 1704
sqrtispec 337793721
sqrtispec1_sh 2711751
sqrtispec2 95527932
sqrtispec2_sh 271266
sqrtr_abs 94741878
sqrtremi 3769626
subiispec 3405772056
subiuspec 1594800216
truncr 2544978
umodiu 1430278080
xmpn_copy 1106248029
xmpn_zero 94741878

Generated by: LCOV version 1.16