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 30835-e55edf4b45) Lines: 605 680 89.0 %
Date: 2026-04-25 09:26:46 Functions: 214 238 89.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fl_add 6149633581
Fl_addmul_pre 7664274171
Fl_addmulmul_pre 64609187
Fl_center 4486164
Fl_div 46761028
Fl_double 443206598
Fl_ellj_pre 238054
Fl_halve 18772395
Fl_mul 2435217756
Fl_mul_pre 4223250106
Fl_neg 728937689
Fl_sqr 99529213
Fl_sqr_pre 2338027219
Fl_sub 7396536654
Fl_triple 87386480
Mod16 389733
Mod2 2370234
Mod32 311108
Mod4 43853721
Mod64 0
Mod8 2073902
abscmpiu 32244537
abscmpui 32244409
absequaliu 39546715
absequalui 41296739
absi 2069115804
absi_shallow 56286655
absr 20510
absrnz_equal1 4556900
absrnz_equal2n 1301152
addii 12532869814
addir 482806951
addis 194788971
addiu 96549758
addri 1106273
addrr 2933065871
addrs 12364076
addsi 319975306
addss 25067
addui 100624856
adduu 3447842849
affectsign 0
affectsign_safe 10729867
affii 964714225
affrr_fixlg 56115688
affsi 6446430
affsr 501438689
affui 45491533
affur 14266656
ceildivuu 3904250
cgetg 25519373618
cgetg_block 424561
cgetg_copy 1492191463
cgeti 27478592750
cgetineg 298996636
cgetipos 16449603483
cgetr 1875943022
cgetr_block 44309
cmpir 9461265
cmpis 3634529
cmpiu 12981957
cmpri 302870
cmprs 40996
cmpsi 3866529
cmpsr 796117
cmpss 1392943
cmpui 12982153
cmpuu 1490537838
divii 14043069
divsi_rem 0
divss 0
divss_rem 0
dvdii 16900271
dvdiiz 0
dvdis 33737
dvdisz 0
dvdiu 576276
dvdiuz 0
dvdsi 371
dvdui 167195
dvmdis 0
dvmdsBIL 7150156642
dvmdsi 0
dvmdss 0
dvmduBIL 165711921
equalis 1151268
equaliu 3021824
equalsi 1151450
equalui 3021823
evalexpo 13397215827
evallg 96859916425
evalprecp 78672902
evalvalp 81629508
evalvalser 24359582
expi 2425372989
expu 797129382
fixlg 105855550
fractor 7380431
gc_NULL 7961546
gc_bool 56792198
gc_const 15653782849
gc_double 184176814
gc_int 2739331
gc_long 242673866
gc_stoi 155900
gc_ulong 51693470
gc_utoi 468756
gc_utoipos 1153593
get_avma 0
hammingu 24048808
icopy 9155331344
icopyspec 118027105
int_bit 20967509
itor 716819141
itos 476288306
itos_or_0 44912024
itou 179081403
itou_or_0 3147016
leafcopy 5064564389
lg2prec 815886197
maxdd 3211852
maxss 9703041982
maxuu 6611112
mindd 264380
minss 2027713096
minuu 69674918
mod16 307013
mod2 62591529
mod2BIL 107451979
mod32 259
mod4 5140999
mod64 0
mod8 15585586
modis 19638526
modsi 45242146
modss 0
mpabs 2140085469
mpabs_shallow 13428463
mpadd 574395066
mpceil 0
mpcmp 2156190
mpcopy 665
mpdiv 395375
mpexpo 38875591
mpfloor 0
mpmul 837146880
mpneg 926921483
mpodd 116095185
mpround 1216578
mpshift 153469015
mpsqr 90783549
mpsub 249720036
mptrunc 49
mulis 467117225
muliu 373351853
mulri 38307235
mulrs 7181596
mulru 2765892
nbits2lg 2405112591
negi 641044561
negr 3683277
new_chunk 95135228237
rcopy 916901105
rdivii 13106299
rdiviiz 13152253
rdivis 0
rdivsi 0
rdivss 839647
real2n 1068647
real_0 1157810
real_0_bit 484233486
real_1 133685994
real_1_bit 4714274
real_m1 455
real_m2n 126
remii 3062328374
remis 0
remlll_pre 75648070
remsi 0
remss 0
rtor 303784903
sdivsi 102146
sdivsi_rem 51446760
sdivss_rem 0
set_avma 131355629294
setabssign 2207401106
shift_left 7798087261
shift_right 5732694665
shiftl 0
shiftlr 0
shiftr 188191234
shiftr_inplace 466943688
smodis 21176088
smodss 12520258
stack_calloc 110666
stack_calloc_align 3325
stack_malloc 46924365
stack_malloc_align 55535154
stackdummy 3683624964
stoi 799131913
stor 501751485
subii 7719001332
subir 3000046
subis 171735
subiu 133460448
subri 6055460
subrr 1006492386
subrs 16544421
subsi 6184589
subss 25067
subui 138437666
subuu 25067
thuemorseu 3313
togglesign 1953736794
togglesign_safe 157242968
truedivii 54709532
truedivis 268374
truedivsi 6202318
uabsdiviu_rem 11892741
uabsdivui_rem 16693
udivuu_rem 2418379
ugcdiu 10320895
ugcdui 2737
umodi2n 48997026
umodsu 734178029
umodui 711392
umuluu_le 7617880
umuluu_or_0 6263876
utoi 12052179757
utoineg 298136182
utoipos 14267504492
utor 14266533
uutoi 8937935879
uutoineg 362668
vali 191179830
varncmp 199457155
varnmax 203
varnmin 10374

Generated by: LCOV version 1.16