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 30861-40e9da58f9) Lines: 1115 1153 96.7 %
Date: 2026-05-04 09:27:01 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 795
pari_kernel_init 797
sqrispec_fft 1704
incneg 50013
muliispec_fft 83910
muliifft_unspliti 85614
mulliifft_params 85614
resetloop 130695
diviuuexact 150054
muluui 166722
muliifft_spliti 169524
divis 245262
sqrtispec2_sh 271365
convi 319870
Zf_sqr 456960
convi_dac 740154
setloop 2248413
truncr 2564316
sqrtispec1_sh 2712669
sqrtremi 3770661
floorr 5205657
Zf_mul 15406080
muliifft_dis 15777426
remi2n 20289216
diviuexact 22349592
diviuexact_i 29694207
muliifft_dit 31099596
incpos 34964976
incloop 35267475
red_montgomery 36219024
mantissa2nr 49463640
divis_rem 65911230
sqrtr_abs 94913910
xmpn_zero 94913910
sqrtispec2 95699982
p_sqrtu2 95971347
p_sqrtu1 98684016
divri 115256403
divrr 136918635
Zf_add 188555904
Zf_mulsqrt2 188555904
Zf_sub 191999844
Zf_shift 207298173
equaliispec 228566373
absdiviu_rem 234900786
affir 325078578
sqrtispec 338292108
diviiexact 389895882
Zf_red_destroy 401280648
roundr_up_ip 450185527
catii 485184252
adduispec_offset 492295932
addshiftw 716054874
int_normalize 869303709
sqrispec_basecase 995704515
sqrispec 1005696003
xmpn_copy 1107806532
shiftispec 1291822377
umodiu 1430625411
subiuspec 1595654142
dvmdii 1689210786
adduispec 2393722962
subiispec 3408965412
cmpiispec 4132096983
addiispec 4592956944
muluispec 4841580342
muliispec_basecase 5155929675
muliispec 5384525100

Generated by: LCOV version 1.16