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 30786-ffec283a2b) Lines: 607 680 89.3 %
Date: 2026-04-07 09:25:56 Functions: 214 238 89.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fl_add 6146650627
Fl_addmul_pre 7652540761
Fl_addmulmul_pre 64565637
Fl_center 4486135
Fl_div 46705733
Fl_double 442128176
Fl_ellj_pre 238076
Fl_halve 18766990
Fl_mul 2437667800
Fl_mul_pre 4218082316
Fl_neg 728875247
Fl_sqr 99473805
Fl_sqr_pre 2338073169
Fl_sub 7399507095
Fl_triple 87145303
Mod16 389733
Mod2 2370120
Mod32 311108
Mod4 43853192
Mod64 0
Mod8 2073975
abscmpiu 33108684
abscmpui 33108524
absequaliu 39545988
absequalui 41297051
absi 2066808153
absi_shallow 57162680
absr 19040
absrnz_equal1 4553854
absrnz_equal2n 1300300
addii 12533142189
addir 483039640
addis 194712979
addiu 98284758
addri 1106270
addrr 2931088806
addrs 12361065
addsi 319897972
addss 25067
addui 102359678
adduu 3449185310
affectsign 0
affectsign_safe 10729533
affii 964712794
affrr_fixlg 56107117
affsi 6446043
affsr 501301515
affui 45491533
affur 14335138
ceildivuu 3904480
cgetg 25517058975
cgetg_block 426411
cgetg_copy 1490090804
cgeti 27482055218
cgetineg 298682067
cgetipos 16446485930
cgetr 1875800206
cgetr_block 44272
cmpir 9444787
cmpis 3634478
cmpiu 12983186
cmpri 284263
cmprs 40996
cmpsi 3866477
cmpsr 796090
cmpss 1392943
cmpui 12983342
cmpuu 1490191257
divii 14050940
divsi_rem 0
divss 0
divss_rem 0
dvdii 16906130
dvdiiz 0
dvdis 33737
dvdisz 0
dvdiu 576276
dvdiuz 0
dvdsi 371
dvdui 167195
dvmdis 0
dvmdsBIL 7147426817
dvmdsi 0
dvmdss 0
dvmduBIL 165611595
equalis 1151114
equaliu 3021714
equalsi 1151296
equalui 3021716
evalexpo 13395989404
evallg 96854905616
evalprecp 78670007
evalvalp 81626644
evalvalser 24359582
expi 2424626603
expu 796838933
fixlg 105717838
fractor 7379024
gc_NULL 7962260
gc_bool 56788144
gc_const 15648994638
gc_double 184100750
gc_int 2742469
gc_long 242623443
gc_stoi 155902
gc_ulong 52075621
gc_utoi 468819
gc_utoipos 1153543
get_avma 0
hammingu 24048727
icopy 9152177368
icopyspec 117798607
int_bit 20952103
itor 716806572
itos 476304929
itos_or_0 44910069
itou 179080549
itou_or_0 3147003
leafcopy 5061315582
lg2prec 815894000
maxdd 3211536
maxss 9708333081
maxuu 6610955
mindd 264380
minss 2026386328
minuu 69656559
mod16 307012
mod2 62589094
mod2BIL 107448202
mod32 259
mod4 5140776
mod64 0
mod8 15586226
modis 19638526
modsi 45242126
modss 0
mpabs 2137740228
mpabs_shallow 13428463
mpadd 573021223
mpceil 0
mpcmp 2226343
mpcopy 665
mpdiv 665513
mpexpo 38877065
mpfloor 0
mpmul 837188661
mpneg 926480934
mpodd 116092490
mpround 1216582
mpshift 153481117
mpsqr 91031726
mpsub 251568498
mptrunc 49
mulis 467114910
muliu 373312491
mulri 38284475
mulrs 7181596
mulru 2765892
nbits2lg 2402745811
negi 640845742
negr 3682541
new_chunk 95101024576
rcopy 916735173
rdivii 13102006
rdiviiz 13147003
rdivis 0
rdivsi 0
rdivss 839647
real2n 1068597
real_0 1157700
real_0_bit 482443992
real_1 133636210
real_1_bit 4713924
real_m1 455
real_m2n 126
remii 3061745303
remis 0
remlll_pre 75725586
remsi 0
remss 0
rtor 303747367
sdivsi 102149
sdivsi_rem 51446510
sdivss_rem 0
set_avma 131317033187
setabssign 2204789388
shift_left 7795851885
shift_right 5728535189
shiftl 0
shiftlr 0
shiftr 187931215
shiftr_inplace 466940744
smodis 21176088
smodss 12496392
stack_calloc 110689
stack_calloc_align 3325
stack_malloc 46928602
stack_malloc_align 55535054
stackdummy 3684435802
stoi 799048433
stor 501641837
subii 7719007533
subir 3004967
subis 171739
subiu 133395972
subri 6094025
subrr 1006252188
subrs 16536281
subsi 6184697
subss 25067
subui 138372154
subuu 25067
thuemorseu 3313
togglesign 1953175506
togglesign_safe 157287161
truedivii 54738413
truedivis 268389
truedivsi 6202087
uabsdiviu_rem 11892741
uabsdivui_rem 16693
udivuu_rem 2418379
ugcdiu 10321039
ugcdui 2737
umodi2n 48996746
umodsu 734180795
umodui 711392
umuluu_le 7617880
umuluu_or_0 6252403
utoi 12049676422
utoineg 297821070
utoipos 14262249484
utor 14335024
uutoi 8937057251
uutoineg 362081
vali 190836153
varncmp 198761519
varnmax 203
varnmin 10374

Generated by: LCOV version 1.16