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 30676-32b8a71ec1) Lines: 605 680 89.0 %
Date: 2026-02-14 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 14728
uabsdivui_rem 16693
addss 25067
subss 25067
subuu 25067
dvdis 33709
cmprs 40996
cgetr_block 43763
sdivsi 102149
stack_calloc 110381
gc_stoi 155885
dvdui 167195
subis 170918
Fl_ellj_pre 238054
mod16 241108
mindd 264342
truedivis 266951
cmpri 282310
Mod32 311108
uutoineg 362719
Mod16 389733
cgetg_block 424961
gc_utoi 468583
dvdiu 576268
mpdiv 665622
cmpsr 796103
rdivss 839647
real2n 1067065
addri 1106279
gc_utoipos 1153467
real_0 1156535
equalis 1185506
equalsi 1185687
mpround 1216582
absrnz_equal2n 1292683
umodui 1296274
cmpss 1392943
Mod8 2073953
mpcmp 2226392
Mod2 2370164
udivuu_rem 2418330
gc_int 2631161
mulru 2765892
subir 3005093
equalui 3018224
equaliu 3018225
itou_or_0 3041723
maxdd 3178376
cmpis 3634912
negr 3671312
cmpsi 3866911
ceildivuu 3902340
Fl_center 4486194
absrnz_equal1 4519929
real_1_bit 4705038
maxuu 4814877
mod4 5084755
umuluu_or_0 5518514
umuluu_le 5803291
subsi 6094068
subri 6128559
truedivsi 6202031
affsi 6373365
mulrs 7181596
fractor 7376919
gc_NULL 7962677
cmpir 9433350
ugcdiu 10113279
cmpiu 10132041
cmpui 10132060
affectsign_safe 10727007
uabsdiviu_rem 11892741
addrs 12305071
smodss 12589350
rdivii 13102772
rdiviiz 13146020
mod8 13162188
mpabs_shallow 13428463
utor 13461924
affur 13462051
divii 14051136
subrs 16476025
dvdii 16566962
Fl_halve 18805460
modis 19638526
int_bit 20948317
smodis 21176060
evalvalser 21528999
hammingu 24048411
abscmpiu 33123125
abscmpui 33123273
mulri 38033907
mpexpo 38872835
absequaliu 39398159
absequalui 41147136
itos_or_0 43599927
Mod4 43787246
modsi 45225506
affui 45473825
Fl_div 46583266
stack_malloc 46625158
truedivii 47028371
umodi2n 48930749
sdivsi_rem 51429833
gc_bool 51991592
gc_ulong 52052465
affrr_fixlg 54654304
stack_malloc_align 55497507
absi_shallow 58171956
mod2 61112903
Fl_addmulmul_pre 64636285
minuu 69172317
remlll_pre 75887073
evalprecp 78673068
evalvalp 81629576
mpsqr 91019919
Fl_triple 94466992
Fl_sqr 95867063
addiu 96918459
addui 100562635
mod2BIL 103303488
fixlg 104198127
mpodd 115076442
icopyspec 117433677
togglesign_safe 125524916
real_1 129814620
subiu 131849736
subui 136822448
mpshift 153219287
dvmduBIL 165924327
shiftr 177973967
itou 178275518
addis 181558848
gc_double 184133658
vali 190381601
varncmp 217197822
gc_long 242457116
mpsub 251532921
utoineg 293976324
cgetineg 294837609
rtor 295253594
addsi 306744264
muliu 374485793
itos 462153226
shiftr_inplace 464367075
mulis 466278661
Fl_double 469154671
real_0_bit 479412183
addir 481436150
affsr 486187002
stor 486542021
mpadd 574521600
negi 636887956
itor 714960049
Fl_neg 724004667
umodsu 734126593
stoi 772514924
expu 775458759
lg2prec 800116342
mpmul 837721061
rcopy 903251642
affii 910480829
mpneg 916828838
subrr 1000196319
cgetg_copy 1480337448
cmpuu 1492952929
cgetr 1840411109
togglesign 1912291658
minss 2009633688
absi 2067452772
mpabs 2138237954
Fl_sqr_pre 2178054709
setabssign 2204956052
nbits2lg 2366531368
Fl_mul 2421874975
expi 2448777255
addrr 2877772617
remii 3005904276
adduu 3409610516
stackdummy 3644102168
Fl_mul_pre 4097984074
Fl_add 4402871055
leafcopy 4975714884
shift_right 5633608361
dvmdsBIL 7011618409
Fl_sub 7281050211
subii 7640084843
shift_left 7677140289
Fl_addmul_pre 7682975750
uutoi 8804527032
icopy 9051811451
maxss 9715398344
utoi 11890676968
addii 12407143807
evalexpo 13137081403
utoipos 14139123340
gc_const 15511999255
cgetipos 16303485656
cgetg 24560365502
cgeti 27076832914
new_chunk 93216268435
evallg 95206219532
set_avma 128992935501

Generated by: LCOV version 1.16