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) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31042-0fbe168e69) Lines: 88.5 % 684 605
Test Date: 2026-07-23 17:04:59 Functions: 89.6 % 241 216
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
Fl_add 6560485923
Fl_addmul_pre 8204874665
Fl_addmulmul_pre 74215677
Fl_center 4490059
Fl_div 49584092
Fl_double 521331450
Fl_ellj_pre 242734
Fl_halve 20602613
Fl_mul 2549945700
Fl_mul_pre 4446430611
Fl_neg 741571145
Fl_sqr 108115284
Fl_sqr_pre 2564381561
Fl_sub 7693157347
Fl_triple 100165010
Mod16 389789
Mod2 3533481
Mod32 311157
Mod4 50399119
Mod64 0
Mod8 3247314
abscmpiu 32865244
abscmpui 32865244
absequaliu 45591199
absequalui 47340930
absi 2076228406
absi_shallow 60811604
absr 20510
absrnz_equal1 4559202
absrnz_equal2n 1842427
addii 13116198615
addir 490343164
addis 195206232
addiu 102222221
addri 1111723
addrr 3029488227
addrs 12387776
addsi 320394950
addss 25081
addui 106295978
adduu 3539486944
affectsign 0
affectsign_safe 10756600
affii 1002068619
affrr_fixlg 56699519
affsi 6484711
affsr 507931194
affui 47850644
affur 13344736
ceildivuu 3917034
cgetg 26270823393
cgetg_block 430325
cgetg_copy 1490614409
cgeti 28619617094
cgetineg 301050415
cgetipos 16891357678
cgetr 1945289041
cgetr_block 44727
cmpir 1730069
cmpis 5993292
cmpiu 12999446
cmpri 303853
cmprs 40996
cmpsi 6225291
cmpsr 796228
cmpss 1416033
cmpui 12999446
cmpuu 318024191
divii 15867768
divmpr 3759
divrmp 1202999
divsi_rem 0
divss 0
divss_rem 0
dvdii 17072406
dvdiiz 0
dvdis 33765
dvdisz 0
dvdiu 576287
dvdiuz 0
dvdsi 371
dvdui 167545
dvmdis 0
dvmdsBIL 7366043249
dvmdsi 0
dvmdss 0
dvmduBIL 173120719
equalis 1149916
equaliu 3042309
equalsi 1150098
equalui 3042309
evalexpo 13975745934
evallg 100004113898
evalprecp 78703554
evalvalp 81660157
evalvalser 25309350
expi 2487267218
expu 979965227
fixlg 106536969
fractor 7389437
gc_NULL 7910768
gc_bool 55261798
gc_const 15920757398
gc_double 198803777
gc_int 2818119
gc_long 243065203
gc_stoi 155898
gc_ulong 52320022
gc_utoi 467771
gc_utoipos 1155329
get_avma 0
hammingu 24078784
icopy 9368321144
icopyspec 119685611
int_bit 21029848
itor 752608005
itos 477708673
itos_or_0 44913572
itou 180891853
itou_or_0 4917784
leafcopy 5282488903
lg2prec 838566048
maxdd 3218166
maxss 7486005178
maxuu 6603111
mindd 265749
minss 2060200799
minuu 57525497
mod16 308662
mod2 65777210
mod2BIL 113287416
mod32 259
mod4 7470820
mod64 0
mod8 15674921
modis 19638526
modsi 45242188
modss 0
mpabs 2118301083
mpabs_shallow 13428280
mpadd 599825097
mpceil 0
mpcmp 2163105
mpcopy 665
mpdiv 0
mpexpo 37846690
mpfloor 0
mpmul 891412621
mpneg 951670555
mpodd 118010217
mpround 1216174
mpshift 153963668
mpsqr 91863612
mpsub 273997151
mptrunc 49
mulis 470657510
muliu 379190275
mulri 53048218
mulrs 7181596
mulru 2765059
nbits2lg 2517475294
negi 661250537
negr 3961207
new_chunk 98579159083
newblock 857545
rcopy 1105107009
rdivii 13134317
rdiviiz 13173944
rdivis 0
rdivsi 0
rdivss 839647
real2n 1070081
real_0 1160749
real_0_bit 501714549
real_1 144102007
real_1_bit 4955383
real_m1 455
real_m2n 126
remii 3103483413
remis 0
remlll_pre 79168024
remsi 0
remss 0
rtor 308811757
sdivsi 102165
sdivsi_rem 51446802
sdivss_rem 0
set_avma 135948268425
setabssign 2186875635
shift_left 7840594002
shift_right 5941026382
shiftl 0
shiftlr 0
shiftr 363696412
shiftr_inplace 472339492
smodis 21176116
smodss 13998082
stack_calloc 110641
stack_calloc_align 3325
stack_malloc 46711620
stack_malloc_align 55666583
stackdummy 3740876226
stoi 775953866
stor 507931194
subii 7998570437
subir 3030786
subis 171754
subiu 133453569
subri 14333360
subrr 1062184871
subrs 16573441
subsi 6245224
subss 25081
subui 138448872
subuu 25081
thuemorseu 3313
togglesign 1995761834
togglesign_safe 157533307
truedivii 54910283
truedivis 268440
truedivsi 6202318
uabsdiviu_rem 25949953
uabsdivui_rem 128889
udivuu_rem 2418435
ugcdiu 10312782
ugcdui 2737
umodi2n 57880958
umodsu 734427382
umodui 710986
umuluu_le 7618608
umuluu_or_0 6354289
utoi 12422690193
utoineg 300130856
utoipos 14655443295
utor 13344596
uutoi 9221450532
uutoineg 365874
vali 193216002
varncmp 218513393
varnmax 203
varnmin 26180

Generated by: LCOV version 2.0-1