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

Generated by: LCOV version 1.16