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 30107-5d3c5ac62a) Lines: 1115 1153 96.7 %
Date: 2025-04-01 09:20:36 Functions: 69 70 98.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Zf_add 187488576
Zf_mul 15325056
Zf_mulsqrt2 187488576
Zf_red_destroy 398892054
Zf_shift 206067384
Zf_sqr 448896
Zf_sub 190893876
absdiviu_rem 276990291
addiispec 4569878322
addshiftw 703980819
adduispec 2388380865
adduispec_offset 491433237
addumului 0
affir 320511816
catii 468414366
cmpiispec 4095576507
convi 316822
convi_dac 736188
diviiexact 389182800
divis 721647
divis_rem 65060415
diviuexact 28224111
diviuexact_i 29476611
diviuuexact 149898
divri 113526405
divrr 129541461
dvmdii 1669155798
equaliispec 197809869
floorr 5228313
incloop 35257062
incneg 50013
incpos 34954578
int_normalize 850901577
mantissa2nr 48718581
muliifft_dis 15688713
muliifft_dit 30930189
muliifft_spliti 168819
muliifft_unspliti 85239
muliispec 5424260127
muliispec_basecase 5197480497
muliispec_fft 83580
mulliifft_params 85239
muluispec 4806817323
muluui 166566
p_sqrtu1 94686669
p_sqrtu2 91984647
pari_kernel_close 783
pari_kernel_init 785
pari_kernel_version 2
red_montgomery 36737337
remi2n 18483759
resetloop 130656
roundr_up_ip 444146131
setloop 2247123
shiftispec 1274243535
sqrispec 936767181
sqrispec_basecase 926828448
sqrispec_fft 1659
sqrtispec 325917006
sqrtispec1_sh 2702022
sqrtispec2 91709823
sqrtispec2_sh 274824
sqrtr_abs 90923865
sqrtremi 3763359
subiispec 3379564950
subiuspec 1586760081
truncr 2610042
umodiu 1406973066
xmpn_copy 1068360291
xmpn_zero 90923865

Generated by: LCOV version 1.16