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 30816-9c15a02229) Lines: 605 680 89.0 %
Date: 2026-04-15 09:25:30 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 19775
addss 25067
subss 25067
subuu 25067
dvdis 33737
cmprs 40996
cgetr_block 44280
sdivsi 102151
stack_calloc 110684
gc_stoi 155901
dvdui 167195
subis 171740
Fl_ellj_pre 238046
mindd 264379
truedivis 268368
cmpri 284270
mod16 307029
Mod32 311108
uutoineg 362883
Mod16 389733
cgetg_block 423676
gc_utoi 468755
dvdiu 576273
mpdiv 652082
umodui 711392
cmpsr 796102
rdivss 839647
real2n 1068621
addri 1106265
equalis 1151355
equalsi 1151537
gc_utoipos 1153530
real_0 1157758
mpround 1216579
absrnz_equal2n 1300752
cmpss 1392943
Mod8 2073985
mpcmp 2226381
Mod2 2370151
udivuu_rem 2418379
gc_int 2739344
mulru 2765892
subir 3000046
equaliu 3021802
equalui 3021802
itou_or_0 3147013
maxdd 3211754
cmpis 3634551
negr 3683025
cmpsi 3866550
ceildivuu 3903025
Fl_center 4486191
absrnz_equal1 4555453
real_1_bit 4714233
mod4 5140927
subri 6100982
subsi 6184493
truedivsi 6202318
umuluu_or_0 6282064
affsi 6446439
maxuu 6610972
mulrs 7181596
fractor 7379018
umuluu_le 7617880
gc_NULL 7963279
cmpir 9446661
ugcdiu 10320708
affectsign_safe 10730206
uabsdiviu_rem 11892741
addrs 12362753
smodss 12513151
cmpiu 12982011
cmpui 12982162
rdivii 13105300
rdiviiz 13149330
mpabs_shallow 13428463
divii 14047557
utor 14335908
affur 14336004
mod8 15585237
subrs 16542990
dvdii 16904842
Fl_halve 18750552
modis 19638526
int_bit 20988879
smodis 21176088
hammingu 24048663
evalvalser 24359582
abscmpiu 33202262
abscmpui 33202342
mulri 38307238
mpexpo 38882769
absequaliu 39546773
absequalui 41296846
Mod4 43852340
itos_or_0 44912321
modsi 45242173
affui 45491533
Fl_div 46740427
stack_malloc 46923941
umodi2n 48996061
sdivsi_rem 51446787
gc_ulong 51676841
truedivii 54755099
stack_malloc_align 55540960
affrr_fixlg 56112163
gc_bool 56800011
absi_shallow 57243884
mod2 62589800
Fl_addmulmul_pre 64633621
minuu 69723769
remlll_pre 75642593
evalprecp 78673401
evalvalp 81629823
Fl_triple 87195273
mpsqr 91049587
addiu 98470956
Fl_sqr 99463973
addui 102545952
fixlg 105851231
mod2BIL 107447790
mpodd 116093481
icopyspec 118027022
subiu 133461642
real_1 133658564
subui 138438684
mpshift 153495095
togglesign_safe 157286727
dvmduBIL 165625179
itou 179080968
gc_double 184183918
shiftr 188090349
vali 191178826
addis 194764916
varncmp 199456656
gc_long 242676060
mpsub 249804078
utoineg 298131602
cgetineg 298992655
rtor 303770693
addsi 319951068
muliu 373429919
Fl_double 442040190
shiftr_inplace 466972423
mulis 467127381
itos 476339724
real_0_bit 482478074
addir 482890224
affsr 501375859
stor 501701800
mpadd 573135604
negi 641014552
itor 716925076
Fl_neg 729067194
umodsu 734123106
expu 797042881
stoi 799178077
lg2prec 815935148
mpmul 835535288
rcopy 916841319
mpneg 926811718
affii 964651051
subrr 1006494100
cmpuu 1490478053
cgetg_copy 1492146157
cgetr 1876067958
togglesign 1953757316
minss 2027395363
absi 2069036027
mpabs 2139964532
setabssign 2207274262
Fl_sqr_pre 2334165936
nbits2lg 2403024205
expi 2425087403
Fl_mul 2437588813
addrr 2931624949
remii 3062931304
adduu 3449518043
stackdummy 3686792657
Fl_mul_pre 4214601651
leafcopy 5064089520
shift_right 5731128781
Fl_add 6151845202
dvmdsBIL 7149846777
Fl_sub 7395881731
Fl_addmul_pre 7658464773
subii 7720637658
shift_left 7797270061
uutoi 8939503187
icopy 9155340489
maxss 9705813840
utoi 12052989296
addii 12533485720
evalexpo 13398476982
utoipos 14269046222
gc_const 15654583977
cgetipos 16454237802
cgetg 25526066430
cgeti 27490849441
new_chunk 95145335283
evallg 96886771129
set_avma 131377136064

Generated by: LCOV version 1.16