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 30851-7844d7b3a5) Lines: 1115 1153 96.7 %
Date: 2026-05-03 09:26:29 Functions: 69 70 98.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Zf_add 188555904
Zf_mul 15406080
Zf_mulsqrt2 188555904
Zf_red_destroy 401280648
Zf_shift 207298173
Zf_sqr 456960
Zf_sub 191999844
absdiviu_rem 234903690
addiispec 4592830233
addshiftw 715869699
adduispec 2393617161
adduispec_offset 492296220
addumului 0
affir 324835779
catii 484813902
cmpiispec 4131693618
convi 319665
convi_dac 739083
diviiexact 389833227
divis 245313
divis_rem 65910336
diviuexact 22349790
diviuexact_i 29686461
diviuuexact 150129
divri 115013781
divrr 136168140
dvmdii 1689015246
equaliispec 228561387
floorr 5201928
incloop 35267469
incneg 50013
incpos 34964970
int_normalize 868933683
mantissa2nr 49459701
muliifft_dis 15777426
muliifft_dit 31099596
muliifft_spliti 169524
muliifft_unspliti 85614
muliispec 5384087367
muliispec_basecase 5155491942
muliispec_fft 83910
mulliifft_params 85614
muluispec 4841202792
muluui 166797
p_sqrtu1 98628099
p_sqrtu2 95916114
pari_kernel_close 795
pari_kernel_init 797
pari_kernel_version 2
red_montgomery 36219024
remi2n 20286105
resetloop 130695
roundr_up_ip 449792449
setloop 2248413
shiftispec 1291486470
sqrispec 1005486765
sqrispec_basecase 995495277
sqrispec_fft 1704
sqrtispec 338051700
sqrtispec1_sh 2711985
sqrtispec2 95644749
sqrtispec2_sh 271365
sqrtr_abs 94858677
sqrtremi 3769977
subiispec 3408688362
subiuspec 1595538114
truncr 2544993
umodiu 1430597421
xmpn_copy 1106981007
xmpn_zero 94858677

Generated by: LCOV version 1.16