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 30347-cb65b7994e) Lines: 1115 1153 96.7 %
Date: 2025-06-27 09:22:08 Functions: 69 70 98.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Zf_add 187658496
Zf_mul 15338496
Zf_mulsqrt2 187658496
Zf_red_destroy 399271983
Zf_shift 206264028
Zf_sqr 448896
Zf_sub 191070978
absdiviu_rem 280529736
addiispec 4585753122
addshiftw 707115684
adduispec 2398109823
adduispec_offset 492310320
addumului 0
affir 322689855
catii 473836884
cmpiispec 4119278037
convi 317068
convi_dac 736497
diviiexact 395861394
divis 729540
divis_rem 65790327
diviuexact 28609941
diviuexact_i 29532681
diviuuexact 149898
divri 114058416
divrr 130052346
dvmdii 1684606653
equaliispec 199985982
floorr 5347839
incloop 35259978
incneg 50013
incpos 34957494
int_normalize 857343141
mantissa2nr 49097070
muliifft_dis 15702102
muliifft_dit 30956967
muliifft_spliti 168921
muliifft_unspliti 85290
muliispec 5475563082
muliispec_basecase 5248567776
muliispec_fft 83631
mulliifft_params 85290
muluispec 4857567762
muluui 166566
p_sqrtu1 95581608
p_sqrtu2 92843781
pari_kernel_close 786
pari_kernel_init 788
pari_kernel_version 2
red_montgomery 40596525
remi2n 19992228
resetloop 130656
roundr_up_ip 448599205
setloop 2247333
shiftispec 1284199149
sqrispec 945900918
sqrispec_basecase 935961843
sqrispec_fft 1659
sqrtispec 329487321
sqrtispec1_sh 2737827
sqrtispec2 92568879
sqrtispec2_sh 274902
sqrtr_abs 91781478
sqrtremi 3800685
subiispec 3393704004
subiuspec 1594422057
truncr 2698419
umodiu 1420391916
xmpn_copy 1080597651
xmpn_zero 91781478

Generated by: LCOV version 1.16