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

Generated by: LCOV version 1.16