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 30775-9d8a55740a) Lines: 605 680 89.0 %
Date: 2026-04-05 09:26:48 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
varnmax 203
mod32 259
dvdsi 371
real_m1 455
mpcopy 665
ugcdui 2737
thuemorseu 3313
stack_calloc_align 3325
varnmin 10374
uabsdivui_rem 16693
absr 19040
addss 25067
subss 25067
subuu 25067
dvdis 33737
cmprs 40996
cgetr_block 44302
sdivsi 102148
stack_calloc 110691
gc_stoi 155907
dvdui 167195
subis 171738
Fl_ellj_pre 238059
mindd 264377
truedivis 268372
cmpri 284263
mod16 307017
Mod32 311108
uutoineg 362496
Mod16 389733
cgetg_block 426414
gc_utoi 468787
dvdiu 576275
mpdiv 665536
umodui 711392
cmpsr 796099
rdivss 839647
real2n 1068599
addri 1106191
equalis 1151145
equalsi 1151327
gc_utoipos 1153566
real_0 1157703
mpround 1216579
absrnz_equal2n 1300225
cmpss 1392943
Mod8 2073880
mpcmp 2226351
Mod2 2370111
udivuu_rem 2418379
gc_int 2742573
mulru 2765892
subir 3004955
equaliu 3021729
equalui 3021729
itou_or_0 3147012
maxdd 3211477
cmpis 3634495
negr 3682688
cmpsi 3866493
ceildivuu 3905056
Fl_center 4486191
absrnz_equal1 4553783
real_1_bit 4713878
mod4 5140692
subri 6098826
subsi 6184534
truedivsi 6202024
umuluu_or_0 6315469
affsi 6446044
maxuu 6610907
mulrs 7181596
fractor 7379010
umuluu_le 7617880
gc_NULL 7962508
cmpir 9441957
ugcdiu 10320422
affectsign_safe 10730693
uabsdiviu_rem 11892741
addrs 12360974
smodss 12551218
cmpiu 12981322
cmpui 12981512
rdivii 13103308
rdiviiz 13147313
mpabs_shallow 13428463
divii 14049171
utor 14335110
affur 14335217
mod8 15585883
subrs 16536100
dvdii 16905022
Fl_halve 18773849
modis 19638526
int_bit 20978078
smodis 21176088
hammingu 24048719
evalvalser 24359582
abscmpiu 33351668
abscmpui 33351729
mulri 38284412
mpexpo 38875706
absequaliu 39546321
absequalui 41296304
Mod4 43853266
itos_or_0 44910964
modsi 45242156
affui 45491533
Fl_div 46741913
stack_malloc 46928790
umodi2n 48996408
sdivsi_rem 51446476
gc_ulong 52097795
truedivii 54745027
stack_malloc_align 55534487
affrr_fixlg 56106306
gc_bool 56784356
absi_shallow 57404886
mod2 62589213
Fl_addmulmul_pre 64641207
minuu 69634372
remlll_pre 75682189
evalprecp 78673435
evalvalp 81629839
Fl_triple 87298155
mpsqr 91029614
addiu 98769714
Fl_sqr 99491217
addui 102844767
fixlg 105717175
mod2BIL 107449263
mpodd 116092572
icopyspec 117798405
subiu 133398229
real_1 133637604
subui 138374090
mpshift 153481477
togglesign_safe 157296558
dvmduBIL 165695384
itou 179080457
gc_double 184151660
shiftr 187933074
vali 190835971
addis 194705825
varncmp 198759832
gc_long 242624408
mpsub 251595253
utoineg 297818168
cgetineg 298678859
rtor 303748328
addsi 319884773
muliu 373405743
Fl_double 442901011
shiftr_inplace 466847870
mulis 467123160
itos 476313502
real_0_bit 482107030
addir 483046998
affsr 501319041
stor 501668367
mpadd 572760093
negi 640829114
itor 716842667
Fl_neg 729044854
umodsu 734193902
expu 796840773
stoi 798948175
lg2prec 815903543
mpmul 836973953
rcopy 916759612
mpneg 926467978
affii 964250420
subrr 1006244443
cgetg_copy 1490089664
cmpuu 1490228573
cgetr 1875846029
togglesign 1953220932
minss 2025887351
absi 2066819608
mpabs 2137740398
setabssign 2204786054
Fl_sqr_pre 2338330062
nbits2lg 2402518500
expi 2424361713
Fl_mul 2439219512
addrr 2930911347
remii 3062231813
adduu 3448604855
stackdummy 3685963663
Fl_mul_pre 4221919036
leafcopy 5061355906
shift_right 5729162052
Fl_add 6150181608
dvmdsBIL 7147689004
Fl_sub 7408603731
Fl_addmul_pre 7662205009
subii 7719694939
shift_left 7796036800
uutoi 8933116421
icopy 9152084363
maxss 9716041850
utoi 12045364015
addii 12532999500
evalexpo 13396801861
utoipos 14257737102
gc_const 15649694306
cgetipos 16441107618
cgetg 25526083193
cgeti 27479547515
new_chunk 95120804609
evallg 96861705372
set_avma 131343825139

Generated by: LCOV version 1.16