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 - level1.h (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30657-d14c2a9e4e) Lines: 605 680 89.0 %
Date: 2026-01-29 09:23:20 Functions: 214 238 89.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fl_add 4402412632
Fl_addmul_pre 7674600179
Fl_addmulmul_pre 64670115
Fl_center 4486075
Fl_div 46556900
Fl_double 469144390
Fl_ellj_pre 238046
Fl_halve 18790744
Fl_mul 2420127506
Fl_mul_pre 4092618878
Fl_neg 719419526
Fl_sqr 95856284
Fl_sqr_pre 2174731326
Fl_sub 7274169252
Fl_triple 94459988
Mod16 389733
Mod2 2370153
Mod32 311108
Mod4 43779436
Mod64 0
Mod8 2074067
abscmpiu 32737748
abscmpui 32737901
absequaliu 39661305
absequalui 41410164
absi 2067637972
absi_shallow 57786457
absr 140
absrnz_equal1 4519891
absrnz_equal2n 1292611
addii 12399133053
addir 481429479
addis 181556147
addiu 96154878
addri 1106267
addrr 2877449671
addrs 12305001
addsi 306741765
addss 25067
addui 99798961
adduu 3408955166
affectsign 0
affectsign_safe 10728004
affii 910639283
affrr_fixlg 54652134
affsi 6373085
affsr 486094206
affui 45473825
affur 13462062
ceildivuu 3899685
cgetg 24551677770
cgetg_block 424865
cgetg_copy 1480142674
cgeti 27072569932
cgetineg 294790561
cgetipos 16310994894
cgetr 1840244059
cgetr_block 43795
cmpir 9433602
cmpis 3634887
cmpiu 10132364
cmpri 282310
cmprs 40996
cmpsi 3866885
cmpsr 796104
cmpss 1392943
cmpui 10132389
cmpuu 1492943075
divii 14049784
divsi_rem 0
divss 0
divss_rem 0
dvdii 16562300
dvdiiz 0
dvdis 33709
dvdisz 0
dvdiu 576268
dvdiuz 0
dvdsi 371
dvdui 167195
dvmdis 0
dvmdsBIL 7010696695
dvmdsi 0
dvmdss 0
dvmduBIL 165781327
equalis 1185595
equaliu 3018245
equalsi 1185777
equalui 3018245
evalexpo 13134760774
evallg 95167652468
evalprecp 78665792
evalvalp 81623173
evalvalser 21527935
expi 2448730472
expu 775390531
fixlg 104195613
fractor 7376775
gc_NULL 7961508
gc_bool 51983951
gc_const 15509646168
gc_double 184156992
gc_int 2631169
gc_long 242317163
gc_stoi 155882
gc_ulong 52042130
gc_utoi 468551
gc_utoipos 1153485
get_avma 0
hammingu 24048437
icopy 9047547738
icopyspec 117430727
int_bit 20939052
itor 714790718
itos 462149338
itos_or_0 43599183
itou 178233911
itou_or_0 3041720
leafcopy 4973135229
lg2prec 799773368
maxdd 3178519
maxss 9707431704
maxuu 4814991
mindd 264340
minss 2010012871
minuu 69234265
mod16 241107
mod2 61113507
mod2BIL 103302823
mod32 259
mod4 5083897
mod64 0
mod8 13161461
modis 19638526
modsi 45225516
modss 0
mpabs 2138422970
mpabs_shallow 13428463
mpadd 574348535
mpceil 0
mpcmp 2226412
mpcopy 665
mpdiv 665629
mpexpo 38874696
mpfloor 0
mpmul 837530154
mpneg 916756154
mpodd 115076845
mpround 1216582
mpshift 153204342
mpsqr 91022931
mpsub 251538965
mptrunc 49
mulis 466267966
muliu 374396217
mulri 38033756
mulrs 7181596
mulru 2765892
nbits2lg 2366243482
negi 636821161
negr 3671436
new_chunk 93203349866
rcopy 903255197
rdivii 13103057
rdiviiz 13146279
rdivis 0
rdivsi 0
rdivss 839647
real2n 1067045
real_0 1156515
real_0_bit 479190137
real_1 129815006
real_1_bit 4704883
real_m1 455
real_m2n 126
remii 3005326261
remis 0
remlll_pre 75922636
remsi 0
remss 0
rtor 295250330
sdivsi 102148
sdivsi_rem 51429846
sdivss_rem 0
set_avma 128954123906
setabssign 2205153765
shift_left 7676980344
shift_right 5632426608
shiftl 0
shiftlr 0
shiftr 177981608
shiftr_inplace 464229437
smodis 21176060
smodss 12509166
stack_calloc 110355
stack_calloc_align 3307
stack_malloc 46625033
stack_malloc_align 55498832
stackdummy 3641565182
stoi 772630871
stor 486423775
subii 7639151540
subir 3005070
subis 170917
subiu 131850257
subri 6131372
subrr 1000209102
subrs 16475742
subsi 6093497
subss 25067
subui 136823347
subuu 25067
thuemorseu 2851
togglesign 1912455682
togglesign_safe 125521400
truedivii 47028138
truedivis 266946
truedivsi 6202031
uabsdiviu_rem 11892741
uabsdivui_rem 16693
udivuu_rem 2416412
ugcdiu 10113879
ugcdui 2737
umodi2n 48923122
umodsu 723917097
umodui 1296276
umuluu_le 5803291
umuluu_or_0 5507271
utoi 11892329138
utoineg 293928838
utoipos 14140448727
utor 13461955
uutoi 8806109755
uutoineg 362538
vali 190365335
varncmp 217203072
varnmax 203
varnmin 15547

Generated by: LCOV version 1.16