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 30813-28f64e5615) Lines: 605 680 89.0 %
Date: 2026-04-14 09:26:12 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
varnmax 203
mod32 259
dvdsi 371
real_m1 455
mpcopy 665
ugcdui 2737
thuemorseu 3313
stack_calloc_align 3325
varnmin 10374
uabsdivui_rem 16693
absr 19040
addss 25067
subss 25067
subuu 25067
dvdis 33737
cmprs 40996
cgetr_block 44258
sdivsi 102151
stack_calloc 110688
gc_stoi 155905
dvdui 167195
subis 171740
Fl_ellj_pre 238074
mindd 264383
truedivis 268371
cmpri 284263
mod16 307023
Mod32 311108
uutoineg 362434
Mod16 389733
cgetg_block 423672
gc_utoi 468769
dvdiu 576272
mpdiv 652087
umodui 711392
cmpsr 796104
rdivss 839647
real2n 1068595
addri 1106260
equalis 1151363
equalsi 1151545
gc_utoipos 1153570
real_0 1157735
mpround 1216577
absrnz_equal2n 1300299
cmpss 1392943
Mod8 2073795
mpcmp 2226401
Mod2 2369980
udivuu_rem 2418379
gc_int 2739326
mulru 2765892
subir 3000035
equaliu 3021804
equalui 3021804
itou_or_0 3147019
maxdd 3211635
cmpis 3634506
negr 3682556
cmpsi 3866504
ceildivuu 3904746
Fl_center 4486102
absrnz_equal1 4553937
real_1_bit 4713927
mod4 5140553
subri 6087921
subsi 6184581
truedivsi 6202318
umuluu_or_0 6280146
affsi 6445986
maxuu 6610805
mulrs 7181596
fractor 7379027
umuluu_le 7617880
gc_NULL 7961454
cmpir 9445058
ugcdiu 10320978
affectsign_safe 10729885
uabsdiviu_rem 11892741
addrs 12361427
smodss 12490711
cmpiu 12979588
cmpui 12979735
rdivii 13103466
rdiviiz 13147841
mpabs_shallow 13428463
divii 14046842
utor 14335061
affur 14335170
mod8 15582472
subrs 16541471
dvdii 16902082
Fl_halve 18767350
modis 19638526
int_bit 20978166
smodis 21176088
hammingu 24048672
evalvalser 24359582
abscmpiu 32331856
abscmpui 32331927
mulri 38307206
mpexpo 38878333
absequaliu 39546226
absequalui 41296128
Mod4 43845719
itos_or_0 44911691
modsi 45242163
affui 45491533
Fl_div 46704180
stack_malloc 46923524
umodi2n 48988635
sdivsi_rem 51446778
gc_ulong 51698378
truedivii 54716273
stack_malloc_align 55536942
affrr_fixlg 56106980
absi_shallow 56373736
gc_bool 56798295
mod2 62588823
Fl_addmulmul_pre 64653080
minuu 69695168
remlll_pre 75612635
evalprecp 78674114
evalvalp 81630526
Fl_triple 87386948
mpsqr 91035256
addiu 96729124
Fl_sqr 99483599
addui 100804043
fixlg 105846108
mod2BIL 107443541
mpodd 116091736
icopyspec 118027069
subiu 133463737
real_1 133637417
subui 138440794
mpshift 153477165
togglesign_safe 157247224
dvmduBIL 165609766
itou 179081647
gc_double 184147570
shiftr 187928207
vali 191178210
addis 194717872
varncmp 199456940
gc_long 242676318
mpsub 249726310
utoineg 298119865
cgetineg 298980485
rtor 303752634
addsi 319903142
muliu 373340969
Fl_double 442870858
shiftr_inplace 466884219
mulis 467108387
itos 476279619
real_0_bit 482326756
addir 482868862
affsr 501320695
stor 501656951
mpadd 572909745
negi 641039490
itor 716808336
Fl_neg 729055743
umodsu 734171839
expu 796991321
stoi 799108578
lg2prec 815864198
mpmul 835201586
rcopy 916567275
mpneg 926685064
affii 964543756
subrr 1006297328
cmpuu 1490498680
cgetg_copy 1492099309
cgetr 1875830897
togglesign 1953498450
minss 2027281817
absi 2068802849
mpabs 2139715989
setabssign 2207016892
Fl_sqr_pre 2337286740
nbits2lg 2402592103
expi 2424918567
Fl_mul 2435346640
addrr 2930864816
remii 3062268728
adduu 3447537723
stackdummy 3682220241
Fl_mul_pre 4216670981
leafcopy 5063280474
shift_right 5729961472
Fl_add 6144322869
dvmdsBIL 7148595252
Fl_sub 7387254644
Fl_addmul_pre 7654437489
subii 7720338398
shift_left 7795881292
uutoi 8934624682
icopy 9155090880
maxss 9696025244
utoi 12046557622
addii 12532785225
evalexpo 13395693852
utoipos 14262586745
gc_const 15654217752
cgetipos 16446635809
cgetg 25514898975
cgeti 27484244512
new_chunk 95130886261
evallg 96859256332
set_avma 131356446851

Generated by: LCOV version 1.16