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 30734-f1f26dedcb) Lines: 1115 1153 96.7 %
Date: 2026-03-04 09:24:31 Functions: 69 70 98.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Zf_add 188238528
Zf_mul 15381120
Zf_mulsqrt2 188238528
Zf_red_destroy 400568334
Zf_shift 206929605
Zf_sqr 456960
Zf_sub 191668980
absdiviu_rem 234766773
addiispec 4588708332
addshiftw 710062593
adduispec 2390052873
adduispec_offset 490690626
addumului 0
affir 323925669
catii 474653346
cmpiispec 4117645773
convi 318603
convi_dac 738921
diviiexact 386990016
divis 239034
divis_rem 65909043
diviuexact 22390320
diviuexact_i 29656632
diviuuexact 149898
divri 114502929
divrr 130284999
dvmdii 1680743961
equaliispec 198090285
floorr 5200971
incloop 35267148
incneg 50013
incpos 34964649
int_normalize 857509464
mantissa2nr 49411899
muliifft_dis 15752559
muliifft_dit 31049862
muliifft_spliti 169338
muliifft_unspliti 85521
muliispec 5377373433
muliispec_basecase 5149129032
muliispec_fft 83817
mulliifft_params 85521
muluispec 4836886392
muluui 166566
p_sqrtu1 95537556
p_sqrtu2 92826426
pari_kernel_close 789
pari_kernel_init 791
pari_kernel_version 2
red_montgomery 36218184
remi2n 20285937
resetloop 130656
roundr_up_ip 442610533
setloop 2248395
shiftispec 1283765481
sqrispec 1000567323
sqrispec_basecase 990589803
sqrispec_fft 1704
sqrtispec 329881833
sqrtispec1_sh 2711130
sqrtispec2 92555160
sqrtispec2_sh 271266
sqrtr_abs 91769106
sqrtremi 3769005
subiispec 3397627311
subiuspec 1591871760
truncr 2543955
umodiu 1425076089
xmpn_copy 1082178189
xmpn_zero 91769106

Generated by: LCOV version 1.16