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 30835-e55edf4b45) Lines: 605 680 89.0 %
Date: 2026-04-26 09:26:37 Functions: 214 238 89.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fl_add 6139229395
Fl_addmul_pre 7648281642
Fl_addmulmul_pre 64591313
Fl_center 4486193
Fl_div 46748310
Fl_double 441905207
Fl_ellj_pre 238041
Fl_halve 18763953
Fl_mul 2437120997
Fl_mul_pre 4212629529
Fl_neg 728924716
Fl_sqr 99525949
Fl_sqr_pre 2334946142
Fl_sub 7397126264
Fl_triple 87131693
Mod16 389733
Mod2 2370209
Mod32 311108
Mod4 43848381
Mod64 0
Mod8 2073877
abscmpiu 33012062
abscmpui 33011949
absequaliu 39546139
absequalui 41296161
absi 2069080934
absi_shallow 57053570
absr 20510
absrnz_equal1 4556941
absrnz_equal2n 1301131
addii 12532643310
addir 482813727
addis 194789020
addiu 98090413
addri 1106254
addrr 2931012144
addrs 12364163
addsi 319974501
addss 25067
addui 102165432
adduu 3449494221
affectsign 0
affectsign_safe 10730049
affii 965013168
affrr_fixlg 56115740
affsi 6446344
affsr 501381372
affui 45491533
affur 14266524
ceildivuu 3903699
cgetg 25522282729
cgetg_block 424568
cgetg_copy 1492174790
cgeti 27480636789
cgetineg 299007311
cgetipos 16452029356
cgetr 1875941055
cgetr_block 44235
cmpir 9441890
cmpis 3634435
cmpiu 12984137
cmpri 302870
cmprs 40996
cmpsi 3866432
cmpsr 796105
cmpss 1392943
cmpui 12984295
cmpuu 1490531367
divii 14049986
divsi_rem 0
divss 0
divss_rem 0
dvdii 16900794
dvdiiz 0
dvdis 33737
dvdisz 0
dvdiu 576271
dvdiuz 0
dvdsi 371
dvdui 167195
dvmdis 0
dvmdsBIL 7150093095
dvmdsi 0
dvmdss 0
dvmduBIL 165596851
equalis 1151271
equaliu 3021801
equalsi 1151453
equalui 3021802
evalexpo 13394544039
evallg 96866046661
evalprecp 78672975
evalvalp 81629386
evalvalser 24359582
expi 2425300647
expu 797084911
fixlg 105855336
fractor 7380427
gc_NULL 7962179
gc_bool 56794591
gc_const 15654078546
gc_double 184159212
gc_int 2739320
gc_long 242675236
gc_stoi 155903
gc_ulong 51691143
gc_utoi 468756
gc_utoipos 1153566
get_avma 0
hammingu 24048675
icopy 9154312543
icopyspec 118026802
int_bit 20950426
itor 716828255
itos 476341587
itos_or_0 44911682
itou 179081383
itou_or_0 3147007
leafcopy 5064450762
lg2prec 815901356
maxdd 3211588
maxss 9706555281
maxuu 6611084
mindd 264383
minss 2027714384
minuu 69649259
mod16 307027
mod2 62589349
mod2BIL 107449424
mod32 259
mod4 5140554
mod64 0
mod8 15588343
modis 19638526
modsi 45242140
modss 0
mpabs 2140012944
mpabs_shallow 13428463
mpadd 572265953
mpceil 0
mpcmp 2156173
mpcopy 665
mpdiv 395372
mpexpo 38875578
mpfloor 0
mpmul 834981127
mpneg 926922352
mpodd 116092660
mpround 1216582
mpshift 153474992
mpsqr 90767904
mpsub 249686155
mptrunc 49
mulis 467123782
muliu 373220835
mulri 38307455
mulrs 7181596
mulru 2765892
nbits2lg 2402975466
negi 641044642
negr 3683163
new_chunk 95134794174
rcopy 916881296
rdivii 13106069
rdiviiz 13151986
rdivis 0
rdivsi 0
rdivss 839647
real2n 1068652
real_0 1157799
real_0_bit 481822843
real_1 133703813
real_1_bit 4714217
real_m1 455
real_m2n 126
remii 3061838685
remis 0
remlll_pre 75636548
remsi 0
remss 0
rtor 303782357
sdivsi 102149
sdivsi_rem 51446753
sdivss_rem 0
set_avma 131356822781
setabssign 2207329748
shift_left 7798202881
shift_right 5732745311
shiftl 0
shiftlr 0
shiftr 188190577
shiftr_inplace 466909704
smodis 21176088
smodss 12522539
stack_calloc 110702
stack_calloc_align 3325
stack_malloc 46923641
stack_malloc_align 55532851
stackdummy 3687168420
stoi 799087622
stor 501709701
subii 7718360152
subir 3000037
subis 171738
subiu 133460486
subri 6083171
subrr 1006483866
subrs 16544459
subsi 6184656
subss 25067
subui 138437686
subuu 25067
thuemorseu 3313
togglesign 1953845930
togglesign_safe 157297268
truedivii 54749524
truedivis 268368
truedivsi 6202318
uabsdiviu_rem 11892741
uabsdivui_rem 16693
udivuu_rem 2418379
ugcdiu 10320783
ugcdui 2737
umodi2n 48991796
umodsu 734177449
umodui 711392
umuluu_le 7617880
umuluu_or_0 6261551
utoi 12054508474
utoineg 298146700
utoipos 14270179122
utor 14266416
uutoi 8937790000
uutoineg 362789
vali 191177192
varncmp 199456755
varnmax 203
varnmin 10374

Generated by: LCOV version 1.16