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 30735-65f72320ad) Lines: 1115 1153 96.7 %
Date: 2026-03-11 09:24:10 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 318600
Zf_sqr 456960
convi_dac 738921
setloop 2248395
truncr 2543955
sqrtispec1_sh 2711151
sqrtremi 3769026
floorr 5200971
Zf_mul 15381120
muliifft_dis 15752559
remi2n 20285937
diviuexact 22390311
diviuexact_i 29656626
muliifft_dit 31049862
incpos 34964679
incloop 35267178
red_montgomery 36218184
mantissa2nr 49411899
divis_rem 65909043
sqrtr_abs 91769106
xmpn_zero 91769106
sqrtispec2 92555160
p_sqrtu2 92826426
p_sqrtu1 95537577
divri 114502929
divrr 130284999
Zf_add 188238528
Zf_mulsqrt2 188238528
Zf_sub 191668980
equaliispec 198095301
Zf_shift 206929605
absdiviu_rem 234766686
affir 323925669
sqrtispec 329881833
diviiexact 387114189
Zf_red_destroy 400568400
roundr_up_ip 442610533
catii 474653346
adduispec_offset 491170875
addshiftw 710114373
int_normalize 857536056
sqrispec_basecase 990609858
sqrispec 1000591161
xmpn_copy 1082178189
shiftispec 1283765838
umodiu 1428566124
subiuspec 1592242395
dvmdii 1681467735
adduispec 2390584296
subiispec 3398022786
cmpiispec 4117992123
addiispec 4588929114
muluispec 4837065432
muliispec_basecase 5149351515
muliispec 5377619169

Generated by: LCOV version 1.16