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 30849-48ff4d246c) Lines: 605 680 89.0 %
Date: 2026-05-01 09:26:53 Functions: 214 238 89.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fl_add 6148067518
Fl_addmul_pre 7669634419
Fl_addmulmul_pre 64516351
Fl_center 4489147
Fl_div 46791077
Fl_double 443213500
Fl_ellj_pre 238060
Fl_halve 18765472
Fl_mul 2438170528
Fl_mul_pre 4225175550
Fl_neg 729120520
Fl_sqr 99456655
Fl_sqr_pre 2337670639
Fl_sub 7414592057
Fl_triple 87395389
Mod16 389733
Mod2 2370231
Mod32 311108
Mod4 43857333
Mod64 0
Mod8 2073835
abscmpiu 33352328
abscmpui 33352165
absequaliu 39546256
absequalui 41296264
absi 2070321151
absi_shallow 57403329
absr 20510
absrnz_equal1 4556895
absrnz_equal2n 1301192
addii 12533342344
addir 482828861
addis 194765372
addiu 98769099
addri 1111452
addrr 2930829168
addrs 12364324
addsi 319952753
addss 25067
addui 102842582
adduu 3450227928
affectsign 0
affectsign_safe 10730887
affii 964903515
affrr_fixlg 56115343
affsi 6447161
affsr 501384141
affui 45491533
affur 14268139
ceildivuu 3902729
cgetg 25533359019
cgetg_block 424338
cgetg_copy 1493203963
cgeti 27485583419
cgetineg 299132680
cgetipos 16457174960
cgetr 1875897076
cgetr_block 44319
cmpir 9445356
cmpis 3634557
cmpiu 12969151
cmpri 303003
cmprs 40996
cmpsi 3866555
cmpsr 796114
cmpss 1392943
cmpui 12969206
cmpuu 1490570274
divii 14047003
divsi_rem 0
divss 0
divss_rem 0
dvdii 16906190
dvdiiz 0
dvdis 33751
dvdisz 0
dvdiu 576275
dvdiuz 0
dvdsi 371
dvdui 167195
dvmdis 0
dvmdsBIL 7149938054
dvmdsi 0
dvmdss 0
dvmduBIL 163239929
equalis 1151313
equaliu 3021962
equalsi 1151496
equalui 3021962
evalexpo 13393369687
evallg 96900585670
evalprecp 78668287
evalvalp 81624938
evalvalser 24359743
expi 2425936278
expu 797144263
fixlg 105864870
fractor 7379562
gc_NULL 7964384
gc_bool 56817942
gc_const 15656247828
gc_double 184130659
gc_int 2739555
gc_long 242688784
gc_stoi 155901
gc_ulong 51681411
gc_utoi 468712
gc_utoipos 1153590
get_avma 0
hammingu 24048748
icopy 9157670483
icopyspec 118071983
int_bit 20976554
itor 716819488
itos 476320812
itos_or_0 44911595
itou 179086998
itou_or_0 3146572
leafcopy 5065181896
lg2prec 815896157
maxdd 3211529
maxss 9717604067
maxuu 6611133
mindd 264379
minss 2027974668
minuu 69666208
mod16 307007
mod2 62589868
mod2BIL 107449124
mod32 259
mod4 5140878
mod64 0
mod8 15584741
modis 19638526
modsi 45242160
modss 0
mpabs 2141256198
mpabs_shallow 13428463
mpadd 572238848
mpceil 0
mpcmp 2161451
mpcopy 665
mpdiv 395508
mpexpo 38876054
mpfloor 0
mpmul 834936095
mpneg 926937601
mpodd 116093301
mpround 1216580
mpshift 153466058
mpsqr 90770195
mpsub 249683580
mptrunc 49
mulis 467110396
muliu 373509522
mulri 38306125
mulrs 7181596
mulru 2765892
nbits2lg 2402786931
negi 641063858
negr 3683334
new_chunk 95172975413
rcopy 916946377
rdivii 13104702
rdiviiz 13151255
rdivis 0
rdivsi 0
rdivss 839647
real2n 1068657
real_0 1159203
real_0_bit 481790909
real_1 133703193
real_1_bit 4714188
real_m1 455
real_m2n 126
remii 3062938363
remis 0
remlll_pre 75610738
remsi 0
remss 0
rtor 303778674
sdivsi 102149
sdivsi_rem 51446774
sdivss_rem 0
set_avma 131407840894
setabssign 2208651495
shift_left 7797935553
shift_right 5732388921
shiftl 0
shiftlr 0
shiftr 188192700
shiftr_inplace 466874054
smodis 21176102
smodss 12480080
stack_calloc 110705
stack_calloc_align 3325
stack_malloc 46928882
stack_malloc_align 55535901
stackdummy 3689363290
stoi 799065402
stor 501703931
subii 7718087979
subir 3000315
subis 171738
subiu 133449987
subri 6085289
subrr 1006380045
subrs 16544514
subsi 6184414
subss 25067
subui 138427013
subuu 25067
thuemorseu 3313
togglesign 1953903100
togglesign_safe 157272417
truedivii 54734173
truedivis 268380
truedivsi 6202318
uabsdiviu_rem 11892741
uabsdivui_rem 16693
udivuu_rem 2418379
ugcdiu 10319994
ugcdui 2737
umodi2n 49000450
umodsu 734140656
umodui 711392
umuluu_le 7617880
umuluu_or_0 6289601
utoi 12056757018
utoineg 298271893
utoipos 14273473775
utor 14268018
uutoi 8939665371
uutoineg 362784
vali 191296705
varncmp 199680451
varnmax 203
varnmin 10374

Generated by: LCOV version 1.16