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 30764-6b81f1f3fa) Lines: 1115 1153 96.7 %
Date: 2026-03-23 09:27:26 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 792
pari_kernel_init 794
sqrispec_fft 1704
incneg 50013
muliispec_fft 83862
muliifft_unspliti 85566
mulliifft_params 85566
resetloop 130656
diviuuexact 150129
muluui 166797
muliifft_spliti 169428
divis 245628
sqrtispec2_sh 271266
convi 319035
Zf_sqr 456960
convi_dac 738921
setloop 2248398
truncr 2544978
sqrtispec1_sh 2711751
sqrtremi 3769626
floorr 5201916
Zf_mul 15393408
muliifft_dis 15764802
remi2n 20286087
diviuexact 22392822
diviuexact_i 29659023
muliifft_dit 31074348
incpos 34964829
incloop 35267328
red_montgomery 36218184
mantissa2nr 49456953
divis_rem 65910105
sqrtr_abs 94741875
xmpn_zero 94741875
sqrtispec2 95527929
p_sqrtu2 95799195
p_sqrtu1 98510946
divri 114999012
divrr 136094145
Zf_add 188395200
Zf_mulsqrt2 188395200
Zf_sub 191832396
equaliispec 198383004
Zf_shift 207111684
absdiviu_rem 234810015
affir 324810843
sqrtispec 337793715
diviiexact 388118511
Zf_red_destroy 400920264
roundr_up_ip 449700034
catii 484531572
adduispec_offset 491263947
addshiftw 715240026
int_normalize 867715275
sqrispec_basecase 995784909
sqrispec 1005766212
xmpn_copy 1106248014
shiftispec 1290822888
umodiu 1429372044
subiuspec 1594450467
dvmdii 1686784554
adduispec 2391681456
subiispec 3404839887
cmpiispec 4125899259
addiispec 4589967645
muluispec 4839198540
muliispec_basecase 5151534318
muliispec 5379895296

Generated by: LCOV version 1.16