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 30719-2b7f142d49) Lines: 1115 1153 96.7 %
Date: 2026-03-01 09:23:56 Functions: 69 70 98.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Zf_add 188238528
Zf_mul 15381120
Zf_mulsqrt2 188238528
Zf_red_destroy 400568400
Zf_shift 206929605
Zf_sqr 456960
Zf_sub 191668980
absdiviu_rem 234812985
addiispec 4589003649
addshiftw 710088222
adduispec 2390506509
adduispec_offset 491115630
addumului 0
affir 323928930
catii 474645192
cmpiispec 4116999576
convi 318378
convi_dac 739068
diviiexact 387226908
divis 239031
divis_rem 65918394
diviuexact 22390335
diviuexact_i 29660841
diviuuexact 149898
divri 114499098
divrr 130287933
dvmdii 1681481979
equaliispec 198955980
floorr 5204907
incloop 35267175
incneg 50013
incpos 34964676
int_normalize 857474517
mantissa2nr 49394493
muliifft_dis 15752559
muliifft_dit 31049862
muliifft_spliti 169338
muliifft_unspliti 85521
muliispec 5377987881
muliispec_basecase 5149731342
muliispec_fft 83817
mulliifft_params 85521
muluispec 4837462677
muluui 166566
p_sqrtu1 95532561
p_sqrtu2 92821875
pari_kernel_close 789
pari_kernel_init 791
pari_kernel_version 2
red_montgomery 36216750
remi2n 20315364
resetloop 130656
roundr_up_ip 442626142
setloop 2248395
shiftispec 1283670462
sqrispec 946330389
sqrispec_basecase 936349080
sqrispec_fft 1704
sqrtispec 329873196
sqrtispec1_sh 2710686
sqrtispec2 92550600
sqrtispec2_sh 271275
sqrtr_abs 91764534
sqrtremi 3768582
subiispec 3398096904
subiuspec 1592174607
truncr 2555445
umodiu 1428391833
xmpn_copy 1082154381
xmpn_zero 91764534

Generated by: LCOV version 1.16