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

Generated by: LCOV version 1.16