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 30613-2b070936c6) Lines: 605 680 89.0 %
Date: 2026-01-15 09:21:54 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 102150
stack_calloc 110353
gc_stoi 155879
dvdui 167195
subis 170919
Fl_ellj_pre 238053
mod16 241107
mindd 264338
truedivis 266947
cmpri 282310
Mod32 311108
uutoineg 362058
Mod16 389733
cgetg_block 407186
gc_utoi 468648
dvdiu 576263
mpdiv 665645
cmpsr 796102
rdivss 839647
real2n 1067018
addri 1105787
gc_utoipos 1153493
real_0 1156443
equalis 1185613
equalsi 1185796
mpround 1216578
absrnz_equal2n 1292673
umodui 1296276
cmpss 1379853
Mod8 2074019
mpcmp 2225888
Mod2 2370201
udivuu_rem 2416412
gc_int 2631175
mulru 2765892
subir 3005088
equaliu 3018183
equalui 3018185
itou_or_0 3041715
maxdd 3178347
cmpis 3634821
negr 3671220
cmpsi 3866820
ceildivuu 3904004
Fl_center 4486194
absrnz_equal1 4519877
real_1_bit 4704803
maxuu 4814953
mod4 5083731
umuluu_or_0 5532653
umuluu_le 5803291
subsi 6093321
subri 6111049
truedivsi 6202031
affsi 6373119
mulrs 7181596
fractor 7376758
gc_NULL 7962846
cmpir 9451245
ugcdiu 10113809
cmpiu 10132180
cmpui 10132204
affectsign_safe 10726994
uabsdiviu_rem 11892741
addrs 12304931
smodss 12489561
rdivii 13101817
rdiviiz 13145269
mod8 13162008
mpabs_shallow 13428463
utor 13461797
affur 13461914
divii 14045512
subrs 16475574
dvdii 16558313
Fl_halve 18786823
modis 19638526
int_bit 20941503
smodis 21176060
evalvalser 21527935
hammingu 24048407
abscmpiu 32518204
abscmpui 32518390
mulri 38033769
mpexpo 38877463
absequaliu 39660704
absequalui 41409570
itos_or_0 43598969
Mod4 43775341
modsi 45225524
affui 45473824
Fl_div 46554272
stack_malloc 46627185
truedivii 47010000
umodi2n 48919098
sdivsi_rem 51429850
gc_bool 51981484
gc_ulong 52056122
affrr_fixlg 54652572
stack_malloc_align 55500841
absi_shallow 57568452
mod2 61112682
Fl_addmulmul_pre 64616549
minuu 69280181
remlll_pre 75709965
evalprecp 78665382
evalvalp 81622914
mpsqr 91044007
Fl_triple 94361897
addiu 95717400
Fl_sqr 95823693
addui 99361415
mod2BIL 103304382
fixlg 104196034
mpodd 115076163
icopyspec 117424729
togglesign_safe 125505969
real_1 129799100
subiu 131844486
subui 136817557
mpshift 153191054
dvmduBIL 163264622
shiftr 177969096
itou 178232673
addis 181576668
gc_double 184133160
vali 190377868
varncmp 217202929
gc_long 242309077
mpsub 251620181
utoineg 293934383
cgetineg 294795133
rtor 295235634
addsi 306761690
muliu 374389405
itos 462117937
shiftr_inplace 464211987
mulis 466271767
Fl_double 468573611
addir 481417726
real_0_bit 481497084
affsr 486061572
stor 486435907
mpadd 576457208
negi 636859580
itor 714795145
Fl_neg 719286254
umodsu 723949421
stoi 772740020
expu 775349219
lg2prec 799824356
mpmul 839708628
rcopy 903205791
affii 910202063
mpneg 916774388
subrr 1000187017
cgetg_copy 1480091174
cmpuu 1492609943
cgetr 1840036963
togglesign 1912037615
minss 2009493915
absi 2068241533
mpabs 2139058525
Fl_sqr_pre 2174802476
setabssign 2205789932
nbits2lg 2367415927
Fl_mul 2418488931
expi 2448369465
addrr 2878890103
remii 3004349330
adduu 3408817140
stackdummy 3638110458
Fl_mul_pre 4095435150
Fl_add 4402303585
leafcopy 4972847118
shift_right 5631348614
dvmdsBIL 7009193443
Fl_sub 7260923792
subii 7653898662
Fl_addmul_pre 7673421596
shift_left 7675002652
uutoi 8808036103
icopy 9051448458
maxss 9696285883
utoi 11897459331
addii 12402838113
evalexpo 13134865833
utoipos 14144829152
gc_const 15508749174
cgetipos 16309562089
cgetg 24547917911
cgeti 27090493675
new_chunk 93208299482
evallg 95190540959
set_avma 128963386443

Generated by: LCOV version 1.16