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 30610-dfc8ed42cd) Lines: 605 680 89.0 %
Date: 2026-01-14 09:22:13 Functions: 214 238 89.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fl_add 4396767210
Fl_addmul_pre 7679161193
Fl_addmulmul_pre 64622279
Fl_center 4486092
Fl_div 46533663
Fl_double 468507878
Fl_ellj_pre 238068
Fl_halve 18779350
Fl_mul 2420172703
Fl_mul_pre 4098039548
Fl_neg 719271315
Fl_sqr 95818687
Fl_sqr_pre 2173615906
Fl_sub 7274772680
Fl_triple 94221667
Mod16 389733
Mod2 2370212
Mod32 311108
Mod4 43776813
Mod64 0
Mod8 2074071
abscmpiu 32989329
abscmpui 32989509
absequaliu 39661137
absequalui 41409949
absi 2068325132
absi_shallow 58039081
absr 140
absrnz_equal1 4519801
absrnz_equal2n 1292565
addii 12403591837
addir 481399521
addis 181543967
addiu 96670746
addri 1105792
addrr 2878651472
addrs 12304880
addsi 306728407
addss 25067
addui 100314765
adduu 3409470937
affectsign 0
affectsign_safe 10726748
affii 910223311
affrr_fixlg 54653169
affsi 6372976
affsr 486081876
affui 45473823
affur 13461842
ceildivuu 3899232
cgetg 24552118312
cgetg_block 407188
cgetg_copy 1480038381
cgeti 27089833979
cgetineg 294800535
cgetipos 16310307379
cgetr 1839976363
cgetr_block 43794
cmpir 9448320
cmpis 3634821
cmpiu 10131624
cmpri 282310
cmprs 40996
cmpsi 3866820
cmpsr 796102
cmpss 1379853
cmpui 10131653
cmpuu 1492607933
divii 14041557
divsi_rem 0
divss 0
divss_rem 0
dvdii 16550095
dvdiiz 0
dvdis 33709
dvdisz 0
dvdiu 576265
dvdiuz 0
dvdsi 371
dvdui 167195
dvmdis 0
dvmdsBIL 7009285526
dvmdsi 0
dvmdss 0
dvmduBIL 165707488
equalis 1185545
equaliu 3018195
equalsi 1185727
equalui 3018196
evalexpo 13133320853
evallg 95199755916
evalprecp 78668693
evalvalp 81625958
evalvalser 21527935
expi 2448420007
expu 775359975
fixlg 104196659
fractor 7376764
gc_NULL 7964573
gc_bool 51973306
gc_const 15508958063
gc_double 184100019
gc_int 2631160
gc_long 242315808
gc_stoi 155884
gc_ulong 52043514
gc_utoi 468545
gc_utoipos 1153464
get_avma 0
hammingu 24048445
icopy 9051731031
icopyspec 117424280
int_bit 20950889
itor 714765891
itos 462110792
itos_or_0 43599392
itou 178232705
itou_or_0 3041718
leafcopy 4973569630
lg2prec 799850351
maxdd 3178424
maxss 9710165086
maxuu 4815144
mindd 264338
minss 2009320533
minuu 69233111
mod16 241102
mod2 61113409
mod2BIL 103304147
mod32 259
mod4 5083942
mod64 0
mod8 13162080
modis 19638526
modsi 45225556
modss 0
mpabs 2139128899
mpabs_shallow 13428463
mpadd 576095582
mpceil 0
mpcmp 2225876
mpcopy 665
mpdiv 665640
mpexpo 38873016
mpfloor 0
mpmul 839246971
mpneg 916743914
mpodd 115076848
mpround 1216592
mpshift 153172364
mpsqr 91027690
mpsub 251529703
mptrunc 49
mulis 466278081
muliu 374462156
mulri 38033686
mulrs 7181596
mulru 2765892
nbits2lg 2367219112
negi 636837498
negr 3671320
new_chunk 93217378523
rcopy 903167990
rdivii 13101672
rdiviiz 13145445
rdivis 0
rdivsi 0
rdivss 839647
real2n 1067007
real_0 1156391
real_0_bit 481168904
real_1 129786297
real_1_bit 4704698
real_m1 455
real_m2n 126
remii 3004854897
remis 0
remlll_pre 75714807
remsi 0
remss 0
rtor 295237108
sdivsi 102150
sdivsi_rem 51429884
sdivss_rem 0
set_avma 128973542651
setabssign 2205855707
shift_left 7674937772
shift_right 5631133616
shiftl 0
shiftlr 0
shiftr 177964622
shiftr_inplace 464205414
smodis 21176060
smodss 12490873
stack_calloc 110365
stack_calloc_align 3307
stack_malloc 46626858
stack_malloc_align 55495306
stackdummy 3641599550
stoi 772630843
stor 486447779
subii 7653699729
subir 3005087
subis 170920
subiu 131840246
subri 6095369
subrr 1000095116
subrs 16475365
subsi 6093334
subss 25067
subui 136813198
subuu 25067
thuemorseu 2851
togglesign 1912039687
togglesign_safe 125502504
truedivii 47002492
truedivis 266954
truedivsi 6202031
uabsdiviu_rem 11892741
uabsdivui_rem 16693
udivuu_rem 2416412
ugcdiu 10113628
ugcdui 2737
umodi2n 48920610
umodsu 723915891
umodui 1296276
umuluu_le 5803291
umuluu_or_0 5514191
utoi 11897194433
utoineg 293939160
utoipos 14144890896
utor 13461747
uutoi 8807381099
uutoineg 361955
vali 190376528
varncmp 217202954
varnmax 203
varnmin 15547

Generated by: LCOV version 1.16