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 30111-a34de28cf8) Lines: 605 765 79.1 %
Date: 2025-04-02 09:20:49 Functions: 219 285 76.8 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fl_add 4305974321
Fl_addmul_pre 7569994950
Fl_addmulmul_pre 55792010
Fl_center 4023241
Fl_div 46305486
Fl_double 451871550
Fl_ellj_pre 224650
Fl_halve 17002443
Fl_mul 2376203322
Fl_mul_pre 3954132796
Fl_neg 706402125
Fl_sqr 92065310
Fl_sqr_pre 2103068627
Fl_sub 7183396294
Fl_triple 89636032
Mod16 277446
Mod2 2024379
Mod32 199255
Mod4 44811926
Mod64 0
Mod8 2070376
abscmpiu 31679080
abscmpui 31679216
absequaliu 39804283
absequalui 41553201
absi 2082757767
absi_shallow 58233769
absr 140
absrnz_equal1 4510538
absrnz_equal2n 1273441
addii 12304262409
addiiz 0
addir 474504065
addirz 0
addis 180220115
addiu 95106112
addri 1101692
addriz 0
addrr 2854698750
addrrz 1307127
addrs 12139117
addsi 305403243
addsiz 0
addsrz 0
addss 25067
addssz 0
addui 98604881
adduu 3386605974
affectsign 0
affectsign_safe 10723252
affii 908261748
affiz 282982
affrr_fixlg 55239358
affsi 6169728
affsr 490019347
affsz 0
affui 45472039
affur 13431959
ceildivuu 3724268
cgetg 24252889389
cgetg_block 387267
cgetg_copy 1456785542
cgeti 26960624264
cgetineg 263746194
cgetipos 16244599488
cgetr 1839144163
cgetr_block 42520
cmpir 9230960
cmpis 3632751
cmpiu 9653663
cmpri 282303
cmprs 40996
cmpsi 3864755
cmpsr 819613
cmpss 1314830
cmpui 9653659
cmpuu 1435938483
divii 14017980
diviiz 0
divirz 0
divisz 0
divriz 0
divrrz 508
divrsz 0
divsi_rem 0
divsiz 0
divsrz 0
divss 0
divss_rem 0
divssz 0
dvdii 16094126
dvdiiz 1316
dvdis 33912
dvdisz 0
dvdiu 576451
dvdiuz 0
dvdsi 371
dvdui 167195
dvmdiiz 0
dvmdis 0
dvmdisz 0
dvmdsBIL 6995968414
dvmdsi 0
dvmdsiz 0
dvmdss 0
dvmdssz 0
dvmduBIL 165004879
equalis 1096827
equaliu 2955361
equalsi 1097009
equalui 2955362
evalexpo 13120712632
evallg 94470575816
evalprecp 78663485
evalvalp 81622922
evalvalser 21442344
expi 2419569932
expu 775726618
fixlg 103080487
fractor 7376790
gc_NULL 7312944
gc_bool 48015770
gc_const 15385212640
gc_double 180654578
gc_int 2569952
gc_long 238057025
gc_stoi 150795
gc_ulong 36287444
gc_utoi 468569
gc_utoipos 1123616
get_avma 0
icopy 9022534514
icopyspec 115579199
int_bit 21031510
itor 706940176
itos 455604779
itos_or_0 24019573
itou 171901421
itou_or_0 2995316
leafcopy 4962297998
lg2prec 798917457
maxdd 3125973
maxss 9521458238
maxuu 4749077
mindd 257520
minss 2000608137
minuu 66076142
mod16 236235
mod2 60387140
mod2BIL 100955769
mod32 259
mod4 4675407
mod64 0
mod8 12870518
modis 19602559
modisz 0
modsi 45222846
modsiz 0
modss 0
modssz 0
mpabs 2159394135
mpabs_shallow 13428442
mpadd 570603027
mpaddz 0
mpaff 674880
mpceil 0
mpcmp 2140654
mpcopy 707
mpdiv 664870
mpexpo 38549846
mpfloor 0
mpmul 832544102
mpmulz 0
mpneg 919235492
mpodd 114109568
mpround 1216459
mpshift 153111664
mpsqr 90147733
mpsub 250463070
mpsubz 0
mptrunc 49
muliiz 0
mulirz 0
mulis 463737383
muliu 370814343
mulri 37881520
mulriz 0
mulrrz 192514
mulrs 7181596
mulru 2765822
mulsiz 0
mulsrz 0
mulssz 0
nbits2lg 2359378610
negi 640930769
negr 3506610
new_chunk 92565300331
rcopy 893549082
rdivii 13036888
rdiviiz 13080247
rdivis 0
rdivsi 0
rdivss 839647
real2n 1060282
real_0 1064181
real_0_bit 474905017
real_1 130241287
real_1_bit 4683163
real_m1 455
real_m2n 126
remii 2983975268
remiiz 0
remis 0
remisz 0
remlll_pre 75055295
remsi 0
remsiz 0
remss 0
remssz 0
rtor 297011335
sdivsi 102151
sdivsi_rem 51425122
sdivss_rem 0
set_avma 127881340725
setabssign 2225371741
shift_left 7667724611
shift_right 5610335287
shiftl 0
shiftlr 0
shiftr 177879599
shiftr_inplace 475689660
smodis 21140226
smodss 12424159
stack_calloc 109102
stack_calloc_align 3300
stack_malloc 45913307
stack_malloc_align 54710184
stackdummy 3598100172
stoi 741421276
stor 490319318
subii 7586629728
subiiz 28
subir 3003752
subirz 0
subis 170867
subisz 0
subiu 128703514
subri 5996632
subriz 0
subrr 990702680
subrrz 1296706
subrs 16294951
subrsz 0
subsi 5886052
subsiz 0
subsrz 0
subss 25067
subssz 0
subui 132872292
subuu 25067
togglesign 1914895211
togglesign_safe 124524540
truedivii 45981103
truedivis 248392
truedivsi 6202031
uabsdiviu_rem 11892741
uabsdivui_rem 15763
udivuu_rem 158851502
ugcdiu 9974659
ugcdui 2737
umodi2n 49383209
umodsu 720667855
umodui 1296213
umuluu_le 5694608
umuluu_or_0 5533414
utoi 11768878589
utoineg 262892401
utoipos 14078849369
utor 13431852
uutoi 8719756147
uutoineg 318236
vali 185899213
varncmp 228405573
varnmax 203
varnmin 0

Generated by: LCOV version 1.16