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 30848-b1463d63da) Lines: 605 680 89.0 %
Date: 2026-04-30 09:27:33 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 20510
addss 25067
subss 25067
subuu 25067
dvdis 33751
cmprs 40996
cgetr_block 44238
sdivsi 102148
stack_calloc 110668
gc_stoi 155893
dvdui 167195
subis 171738
Fl_ellj_pre 238065
mindd 264382
truedivis 268356
cmpri 303003
mod16 307016
Mod32 311108
uutoineg 362037
Mod16 389733
mpdiv 395508
cgetg_block 424607
gc_utoi 468827
dvdiu 576277
umodui 711392
cmpsr 796120
rdivss 839647
real2n 1068662
addri 1111428
equalis 1151205
equalsi 1151387
gc_utoipos 1153583
real_0 1159193
mpround 1216586
absrnz_equal2n 1301153
cmpss 1392943
Mod8 2073819
mpcmp 2161403
Mod2 2370091
udivuu_rem 2418379
gc_int 2739552
mulru 2765892
subir 3000303
equaliu 3021956
equalui 3021956
itou_or_0 3146253
maxdd 3211544
cmpis 3634489
negr 3683332
cmpsi 3866497
ceildivuu 3904079
Fl_center 4489147
absrnz_equal1 4556854
real_1_bit 4714406
mod4 5140898
subri 6097710
subsi 6184945
truedivsi 6202318
umuluu_or_0 6299465
affsi 6447507
maxuu 6610874
mulrs 7181596
fractor 7379565
umuluu_le 7617880
gc_NULL 7963782
cmpir 9445285
ugcdiu 10320381
affectsign_safe 10730694
uabsdiviu_rem 11892741
addrs 12364020
smodss 12437625
cmpiu 12970267
cmpui 12970286
rdivii 13105478
rdiviiz 13150813
mpabs_shallow 13428463
divii 14055196
utor 14267955
affur 14268067
mod8 15586206
subrs 16544566
dvdii 16895685
Fl_halve 18777858
modis 19638526
int_bit 20940182
smodis 21176102
hammingu 24048765
evalvalser 24359743
abscmpiu 33819367
abscmpui 33819581
mulri 38306470
mpexpo 38877308
absequaliu 39546455
absequalui 41296408
Mod4 43852751
itos_or_0 44911977
modsi 45242195
affui 45491533
Fl_div 46722335
stack_malloc 46929139
umodi2n 48995803
sdivsi_rem 51446809
gc_ulong 51690830
truedivii 54766771
stack_malloc_align 55538742
affrr_fixlg 56115269
gc_bool 56809114
absi_shallow 57872193
mod2 62590379
Fl_addmulmul_pre 64592167
minuu 69704998
remlll_pre 75586387
evalprecp 78668273
evalvalp 81625280
Fl_triple 87164679
mpsqr 90776725
Fl_sqr 99487001
addiu 99706552
addui 103780002
fixlg 105864053
mod2BIL 107449404
mpodd 116094842
icopyspec 118071970
subiu 133447756
real_1 133712867
subui 138424796
mpshift 153505117
togglesign_safe 157320886
dvmduBIL 165650618
itou 179086956
gc_double 184188476
shiftr 188189186
vali 191295878
addis 194769288
varncmp 199680308
gc_long 242694817
mpsub 249756573
utoineg 298266494
cgetineg 299127247
rtor 303791977
addsi 319955614
muliu 373500385
Fl_double 442216510
shiftr_inplace 467042387
mulis 467099400
itos 476372516
real_0_bit 481901865
addir 482840378
affsr 501371994
stor 501728794
mpadd 572415245
negi 641034911
itor 716818663
Fl_neg 729104990
umodsu 734163052
expu 797180755
stoi 799152712
lg2prec 815859257
mpmul 835197722
rcopy 916939448
mpneg 926928989
affii 964944674
subrr 1006600685
cmpuu 1490550746
cgetg_copy 1493226574
cgetr 1875981078
togglesign 1954308924
minss 2028496263
absi 2070403999
mpabs 2141344489
setabssign 2208756678
Fl_sqr_pre 2335750484
nbits2lg 2402682318
expi 2426029098
Fl_mul 2438235999
addrr 2932067305
remii 3062178995
adduu 3451207563
stackdummy 3694769459
Fl_mul_pre 4215380460
leafcopy 5066106352
shift_right 5735967845
Fl_add 6143039799
dvmdsBIL 7152482744
Fl_sub 7418720350
Fl_addmul_pre 7648304657
subii 7718764233
shift_left 7797054207
uutoi 8940332712
icopy 9156490604
maxss 9726358734
utoi 12059938288
addii 12534237906
evalexpo 13394247181
utoipos 14281096602
gc_const 15656412665
cgetipos 16472569734
cgetg 25548191379
cgeti 27485783457
new_chunk 95183599058
evallg 96909085571
set_avma 131424243402

Generated by: LCOV version 1.16