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 30673-b6380924e9) Lines: 1115 1153 96.7 %
Date: 2026-02-08 09:23:25 Functions: 69 70 98.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Zf_add 188081856
Zf_mul 15368832
Zf_mulsqrt2 188081856
Zf_red_destroy 400216536
Zf_shift 206747526
Zf_sqr 456960
Zf_sub 191505564
absdiviu_rem 234812892
addiispec 4597594764
addshiftw 709904793
adduispec 2399705685
adduispec_offset 491138460
addumului 0
affir 323929128
catii 474645270
cmpiispec 4133802612
convi 318059
convi_dac 737838
diviiexact 397058862
divis 239031
divis_rem 65918388
diviuexact 22390290
diviuexact_i 29660787
diviuuexact 149898
divri 114499095
divrr 130288170
dvmdii 1685548557
equaliispec 198956196
floorr 5204907
incloop 35267175
incneg 50013
incpos 34964676
int_normalize 857257278
mantissa2nr 49394472
muliifft_dis 15740316
muliifft_dit 31025376
muliifft_spliti 169248
muliifft_unspliti 85476
muliispec 5400101715
muliispec_basecase 5171937780
muliispec_fft 83772
mulliifft_params 85476
muluispec 4859946534
muluui 166566
p_sqrtu1 95532591
p_sqrtu2 92821911
pari_kernel_close 786
pari_kernel_init 788
pari_kernel_version 2
red_montgomery 36216201
remi2n 20312865
resetloop 130656
roundr_up_ip 442626238
setloop 2248395
shiftispec 1288740921
sqrispec 946373514
sqrispec_basecase 936391389
sqrispec_fft 1704
sqrtispec 329873271
sqrtispec1_sh 2710680
sqrtispec2 92550636
sqrtispec2_sh 271275
sqrtr_abs 91764573
sqrtremi 3768573
subiispec 3403360725
subiuspec 1597873740
truncr 2555445
umodiu 1432390095
xmpn_copy 1082154591
xmpn_zero 91764573

Generated by: LCOV version 1.16