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 30634-7c77b4d1a9) Lines: 605 680 89.0 %
Date: 2026-01-26 09:23:16 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 43773
sdivsi 102148
stack_calloc 110345
gc_stoi 155884
dvdui 167195
subis 170918
Fl_ellj_pre 238036
mod16 241110
mindd 264339
truedivis 266961
cmpri 282310
Mod32 311108
uutoineg 362570
Mod16 389733
cgetg_block 424910
gc_utoi 468570
dvdiu 576270
mpdiv 665628
cmpsr 796100
rdivss 839647
real2n 1067008
addri 1105740
gc_utoipos 1153462
real_0 1156403
equalis 1185522
equalsi 1185703
mpround 1216579
absrnz_equal2n 1292584
umodui 1296276
cmpss 1379853
Mod8 2074001
mpcmp 2225898
Mod2 2370234
udivuu_rem 2416412
gc_int 2631191
mulru 2765892
subir 3005093
equaliu 3018230
equalui 3018230
itou_or_0 3041731
maxdd 3178252
cmpis 3634878
negr 3671290
cmpsi 3866875
ceildivuu 3899398
Fl_center 4486122
absrnz_equal1 4519874
real_1_bit 4704783
maxuu 4814983
mod4 5083959
umuluu_or_0 5518553
umuluu_le 5803291
subsi 6093478
subri 6142248
truedivsi 6202031
affsi 6373119
mulrs 7181596
fractor 7376778
gc_NULL 7961581
cmpir 9435550
ugcdiu 10113921
cmpui 10133572
cmpiu 10133582
affectsign_safe 10725599
uabsdiviu_rem 11892741
addrs 12304985
smodss 12502803
rdivii 13101901
rdiviiz 13145387
mod8 13162591
mpabs_shallow 13428463
utor 13461767
affur 13461861
divii 14048772
subrs 16475551
dvdii 16557217
Fl_halve 18780019
modis 19638526
int_bit 20937845
smodis 21176060
evalvalser 21527935
hammingu 24048420
abscmpui 33758939
abscmpiu 33758989
mulri 38033601
mpexpo 38875834
absequaliu 39660943
absequalui 41409873
itos_or_0 43598507
Mod4 43773955
modsi 45225529
affui 45473824
Fl_div 46480096
stack_malloc 46627205
truedivii 47040128
umodi2n 48917671
sdivsi_rem 51429856
gc_bool 51979671
gc_ulong 52050697
affrr_fixlg 54652276
stack_malloc_align 55502105
absi_shallow 58809984
mod2 61113884
Fl_addmulmul_pre 64594085
minuu 68980846
remlll_pre 75749483
evalprecp 78667111
evalvalp 81623430
mpsqr 91029570
Fl_triple 94240800
Fl_sqr 95850347
addiu 98201753
addui 101845834
mod2BIL 103304326
fixlg 104195534
mpodd 115078041
icopyspec 117430768
togglesign_safe 125536258
real_1 129819442
subiu 131848175
subui 136821142
mpshift 153189633
dvmduBIL 163605232
shiftr 177977010
itou 178233800
addis 181578606
gc_double 184137820
vali 190377402
varncmp 217202714
gc_long 242309554
mpsub 251609265
utoineg 293947990
cgetineg 294809668
rtor 295236622
addsi 306764532
muliu 374398963
itos 462161716
shiftr_inplace 464135816
mulis 466265560
Fl_double 468471987
real_0_bit 479379791
addir 481428106
affsr 486085036
stor 486421366
mpadd 574614006
negi 636840449
itor 714798604
Fl_neg 718992866
umodsu 723912712
stoi 772186347
expu 775376646
lg2prec 799755352
mpmul 837843599
rcopy 903218356
affii 910247537
mpneg 916759543
subrr 1000189443
cgetg_copy 1480186850
cmpuu 1492990047
cgetr 1840194430
togglesign 1912275401
minss 2009235244
absi 2068317221
mpabs 2139101708
Fl_sqr_pre 2172427625
setabssign 2205814352
nbits2lg 2366315602
Fl_mul 2421149025
expi 2448546089
addrr 2877024010
remii 3004819909
adduu 3409927197
stackdummy 3646352429
Fl_mul_pre 4094718154
Fl_add 4403173662
leafcopy 4973025926
shift_right 5631245072
dvmdsBIL 7009280254
Fl_sub 7294625824
subii 7638425973
Fl_addmul_pre 7670684716
shift_left 7676021550
uutoi 8802770051
icopy 9046898026
maxss 9730218105
utoi 11890157812
addii 12395741054
evalexpo 13132372040
utoipos 14138606790
gc_const 15508921421
cgetipos 16308733367
cgetg 24558767566
cgeti 27069214424
new_chunk 93200104948
evallg 95169737483
set_avma 128946084191

Generated by: LCOV version 1.16