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 30658-0716cf3506) Lines: 605 680 89.0 %
Date: 2026-01-31 09:22:40 Functions: 214 238 89.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Mod64 0
affectsign 0
divsi_rem 0
divss 0
divss_rem 0
dvdiiz 0
dvdisz 0
dvdiuz 0
dvmdis 0
dvmdsi 0
dvmdss 0
get_avma 0
mod64 0
modss 0
mpceil 0
mpfloor 0
rdivis 0
rdivsi 0
remis 0
remsi 0
remss 0
sdivss_rem 0
shiftl 0
shiftlr 0
mptrunc 49
real_m2n 126
absr 140
varnmax 203
mod32 259
dvdsi 371
real_m1 455
mpcopy 665
ugcdui 2737
thuemorseu 2851
stack_calloc_align 3307
varnmin 15547
uabsdivui_rem 16693
addss 25067
subss 25067
subuu 25067
dvdis 33709
cmprs 40996
cgetr_block 43594
sdivsi 102147
stack_calloc 110375
gc_stoi 155883
dvdui 167195
subis 170917
Fl_ellj_pre 238044
mod16 241106
mindd 264341
truedivis 266944
cmpri 282310
Mod32 311108
uutoineg 362169
Mod16 389733
cgetg_block 424856
gc_utoi 468539
dvdiu 576263
mpdiv 665635
cmpsr 796099
rdivss 839647
real2n 1067059
addri 1106276
gc_utoipos 1153478
real_0 1156539
equalis 1185665
equalsi 1185847
mpround 1216577
absrnz_equal2n 1292668
umodui 1296276
cmpss 1392943
Mod8 2074018
mpcmp 2226405
Mod2 2370171
udivuu_rem 2416419
gc_int 2631086
mulru 2765892
subir 3005090
equaliu 3018236
equalui 3018237
itou_or_0 3041718
maxdd 3178535
cmpis 3634664
negr 3670959
cmpsi 3866809
ceildivuu 3901945
Fl_center 4486161
absrnz_equal1 4520018
real_1_bit 4705048
maxuu 4814814
mod4 5083706
umuluu_or_0 5508959
umuluu_le 5803291
subsi 6093350
subri 6144430
truedivsi 6202031
affsi 6373286
mulrs 7181596
fractor 7376921
gc_NULL 7962867
cmpir 9435474
ugcdiu 10114005
cmpiu 10132687
cmpui 10132706
affectsign_safe 10726554
uabsdiviu_rem 11892741
addrs 12305129
smodss 12477330
rdivii 13103051
rdiviiz 13146925
mod8 13161703
mpabs_shallow 13428463
utor 13461709
affur 13461819
divii 14049164
subrs 16475977
dvdii 16560982
Fl_halve 18792265
modis 19638526
int_bit 20951548
smodis 21176060
evalvalser 21527935
hammingu 24048411
abscmpiu 32143805
abscmpui 32143977
mulri 38033888
mpexpo 38881325
absequaliu 39661170
absequalui 41410062
itos_or_0 43599025
Mod4 43766448
modsi 45225537
affui 45473825
Fl_div 46557703
stack_malloc 46625225
truedivii 47023881
umodi2n 48913940
sdivsi_rem 51429866
gc_bool 51981169
gc_ulong 52059606
affrr_fixlg 54654078
stack_malloc_align 55506324
absi_shallow 57195161
mod2 61113228
Fl_addmulmul_pre 64650566
minuu 69240317
remlll_pre 75795154
evalprecp 78659802
evalvalp 81617584
mpsqr 91042810
Fl_triple 94579988
addiu 94963825
Fl_sqr 95851079
addui 98607875
mod2BIL 103299213
fixlg 104197350
mpodd 115076932
icopyspec 117430811
togglesign_safe 125501560
real_1 129826212
subiu 131849323
subui 136822459
mpshift 153218952
dvmduBIL 163444559
shiftr 177978425
itou 178234252
addis 181551078
gc_double 184195503
vali 190364239
varncmp 217202974
gc_long 242311314
mpsub 251650961
utoineg 293931441
cgetineg 294793011
rtor 295246237
addsi 306737135
muliu 374459243
itos 462142338
shiftr_inplace 464321383
mulis 466259305
Fl_double 468765034
real_0_bit 479314666
addir 481419124
affsr 485996042
stor 486365993
mpadd 574570951
negi 636874395
itor 715114451
Fl_neg 719569949
umodsu 723956191
stoi 772662722
expu 775333468
lg2prec 799932435
mpmul 837867153
rcopy 903196295
affii 910652110
mpneg 916821405
subrr 1000301131
cgetg_copy 1480165456
cmpuu 1492909800
cgetr 1840522631
togglesign 1912490424
minss 2010349035
absi 2067624705
mpabs 2138420585
Fl_sqr_pre 2172595491
setabssign 2205142382
nbits2lg 2366565401
Fl_mul 2419225294
expi 2448637712
addrr 2877829211
remii 3006520858
adduu 3408000389
stackdummy 3637331845
Fl_mul_pre 4084602728
Fl_add 4374196564
leafcopy 4972400250
shift_right 5632726429
dvmdsBIL 7011346416
Fl_sub 7257112380
subii 7640234464
Fl_addmul_pre 7671139750
shift_left 7677058065
uutoi 8799238859
icopy 9049510295
maxss 9690817400
utoi 11885648005
addii 12402143908
evalexpo 13134319848
utoipos 14134232907
gc_const 15510408523
cgetipos 16303625273
cgetg 24543796578
cgeti 27063208928
new_chunk 93182816535
evallg 95140556063
set_avma 128927884133

Generated by: LCOV version 1.16