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 30835-e55edf4b45) Lines: 1115 1153 96.7 %
Date: 2026-04-25 09:26:46 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 83907
muliifft_unspliti 85611
mulliifft_params 85611
resetloop 130656
diviuuexact 150129
muluui 166797
muliifft_spliti 169518
divis 245628
sqrtispec2_sh 271362
convi 319424
Zf_sqr 456960
convi_dac 738921
setloop 2248404
truncr 2544993
sqrtispec1_sh 2711757
sqrtremi 3769737
floorr 5201928
Zf_mul 15405696
muliifft_dis 15777045
remi2n 20286069
diviuexact 22348287
diviuexact_i 29646525
muliifft_dit 31098834
incpos 34964892
incloop 35267391
red_montgomery 36218184
mantissa2nr 49459236
divis_rem 65910126
sqrtr_abs 94856868
xmpn_zero 94856868
sqrtispec2 95642931
p_sqrtu2 95914293
p_sqrtu1 98626050
divri 115011330
divrr 136166829
Zf_add 188551872
Zf_mulsqrt2 188551872
Zf_sub 191995812
Zf_shift 207293763
equaliispec 227977368
absdiviu_rem 234878085
affir 324823686
sqrtispec 338049585
diviiexact 389355687
Zf_red_destroy 401272128
roundr_up_ip 449788282
catii 484813308
adduispec_offset 492053628
addshiftw 715669203
int_normalize 868857672
sqrispec_basecase 995441343
sqrispec 1005422700
xmpn_copy 1106976741
shiftispec 1291359528
umodiu 1430402706
subiuspec 1595370741
dvmdii 1689183291
adduispec 2393392032
subiispec 3407496570
cmpiispec 4130368380
addiispec 4592295489
muluispec 4840511988
muliispec_basecase 5154744186
muliispec 5383249452

Generated by: LCOV version 1.16