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) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31092-e6893b0017) Lines: 88.6 % 690 611
Test Date: 2026-09-06 17:02:10 Functions: 89.9 % 247 222
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
Fl_add 6561867157
Fl_addmul_pre 8207295391
Fl_addmulmul_pre 74215698
Fl_center 4490059
Fl_div 49583606
Fl_double 521504892
Fl_ellj_pre 242717
Fl_halve 20602961
Fl_mul 2550742532
Fl_mul_pre 4450616963
Fl_neg 741547937
Fl_sqr 108111290
Fl_sqr_pre 2568499092
Fl_sub 7698425617
Fl_triple 100149458
Mod16 389809
Mod2 3595514
Mod32 311157
Mod4 50720773
Mod64 0
Mod8 3309346
abscmpiu 33134782
abscmpui 33134782
absequaliu 45906155
absequalui 47655925
absi 2076499142
absi_shallow 61198443
absr 20510
absrnz_equal1 4559378
absrnz_equal2n 1580245
addii 13117030248
addir 490367673
addis 195801693
addiu 103013010
addri 1113225
addrr 3031012674
addrs 12387956
addsi 320990411
addss 25081
addui 107087581
adduu 3541990661
affectsign 0
affectsign_safe 10756372
affii 1002956106
affrr_fixlg 56699937
affsi 6484802
affsr 509059099
affui 47976646
affur 13344741
ceildivuu 3916380
cgetg 28026410327
cgetg_block 430408
cgetg_copy 1490930334
cgeti 28643455470
cgetineg 301596015
cgetipos 16903160826
cgetr 192139937
cgetr_block 44721
cmpir 1730069
cmpis 6119308
cmpiu 13000597
cmpri 303857
cmprs 40996
cmpsi 6351307
cmpsr 796228
cmpss 1416201
cmpui 13000597
cmpuu 318396328
divii 16306088
divmpr 3759
divrmp 1203052
divsi_rem 0
divss 0
divss_rem 0
dvdii 17072654
dvdiiz 0
dvdis 33765
dvdisz 0
dvdiu 576287
dvdiuz 0
dvdsi 371
dvdui 167545
dvmdis 0
dvmdsBIL 7387603676
dvmdsi 0
dvmdss 0
dvmduBIL 173060794
equalis 1149891
equaliu 3042330
equalsi 1150073
equalui 3042330
evalexpo 13969944510
evallg 100086554461
evalprecp 78703524
evalvalp 81660127
evalvalser 25309350
expi 2476431886
expu 955698667
fixlg 106531208
fractor 7387946
fractor_lg 7389437
gc_NULL 7912248
gc_bool 55262222
gc_const 15931667215
gc_double 199005076
gc_int 2818785
gc_long 243068512
gc_stoi 155898
gc_ulong 52320437
gc_utoi 467768
gc_utoipos 1155321
get_avma 0
hammingu 24078702
icopy 9396102470
icopyspec 120486901
int_bit 21047197
itor 451929942
itor_lg 739896913
itos 477913866
itos_or_0 44914234
itou 180923037
itou_or_0 5015375
leafcopy 5280194674
lg2prec 30275725
maxdd 3218259
maxss 7481744913
maxuu 6603106
mindd 265754
minss 2044818183
minuu 57538180
mod16 308664
mod2 65902046
mod2BIL 113536037
mod32 259
mod4 7594957
mod64 0
mod8 15674412
modis 19638526
modsi 45242195
modss 0
mpabs 2118572140
mpabs_shallow 13428274
mpadd 598124058
mpceil 0
mpcmp 2164587
mpcopy 665
mpdiv 0
mpexpo 37849114
mpfloor 0
mpmul 889697821
mpneg 952076150
mpodd 118264636
mpround 1216174
mpshift 153967935
mpsqr 91857476
mpsub 273991658
mptrunc 49
mulis 470854133
muliu 379064872
mulri 53835788
mulrs 7181596
mulru 2765059
nbits2lg 1676264329
negi 661645575
negr 3961182
new_chunk 98655625048
newblock 857705
rcopy 1101974644
rdivii 5744744
rdivii_lg 13134307
rdiviiz 13173934
rdivis 0
rdivsi 0
rdivss 839647
real2n 1070095
real_0 1160898
real_0_bit 499142761
real_1 133396579
real_1_bit 4699175
real_m1 455
real_m2n 126
remii 3105479331
remis 0
remlll_pre 79167996
remsi 0
remss 0
rtor 308823525
rtor_lg 308827879
sdivsi 102165
sdivsi_rem 51446809
sdivss_rem 0
set_avma 136045162021
setabssign 2187237309
shift_left 7847926030
shift_right 5948015827
shiftl 0
shiftlr 0
shiftr 363964549
shiftr_inplace 472698854
smodis 21176116
smodss 13998082
stack_calloc 110622
stack_calloc_align 3325
stack_malloc 46736722
stack_malloc_align 55673545
stackdummy 3742544138
stoi 776269277
stor 2140784
stor_lg 509059099
subii 8009934258
subir 3030821
subis 171754
subiu 133456424
subri 1538330
subrr 1063005640
subrs 16573666
subsi 6244894
subss 25081
subui 138451748
subuu 25081
thuemorseu 3311
togglesign 1996717374
togglesign_safe 157556422
truedivii 54943472
truedivis 268455
truedivsi 6202318
uabsdiviu_rem 26737503
uabsdivui_rem 128885
udivuu_rem 2418435
ugcdiu 10312786
ugcdui 2737
umodi2n 58326697
umodsu 734402653
umodui 710986
umuluu_le 7618608
umuluu_or_0 6323765
utoi 12430122198
utoineg 300673253
utoipos 14664228369
utor 13344601
utor_lg 13344601
uutoi 9226676842
uutoineg 365874
vali 194757739
varncmp 218513491
varnmax 203
varnmin 26180

Generated by: LCOV version 2.0-1