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 30547-1b347192b6) Lines: 605 680 89.0 %
Date: 2025-11-13 09:22:32 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
absr 140
varnmax 203
mod32 259
dvdsi 371
real_m1 455
mpcopy 665
ugcdui 2737
thuemorseu 2851
stack_calloc_align 3307
varnmin 15547
uabsdivui_rem 16693
addss 25067
subss 25067
subuu 25067
dvdis 33912
cmprs 40996
cgetr_block 43855
sdivsi 102150
stack_calloc 110564
gc_stoi 155889
dvdui 167195
subis 170994
mod16 241356
Fl_ellj_pre 242629
truedivis 266823
mindd 270162
cmpri 282310
Mod32 311108
uutoineg 355526
Mod16 389733
cgetg_block 408312
gc_utoi 468608
dvdiu 576566
mpdiv 667719
cmpsr 796096
rdivss 839647
real2n 1067393
addri 1109318
gc_utoipos 1153876
real_0 1156553
equalis 1181649
equalsi 1181831
mpround 1216549
absrnz_equal2n 1291382
umodui 1296416
cmpss 1427033
Mod8 2073902
mpcmp 2227503
udivuu_rem 2416419
Mod2 2479217
gc_int 2574291
mulru 2765892
subir 3006671
equaliu 3018665
equalui 3018665
itou_or_0 3041675
maxdd 3182518
cmpis 3633564
negr 3671076
ceildivuu 3848525
cmpsi 3865535
Fl_center 4485572
absrnz_equal1 4518426
real_1_bit 4705951
maxuu 4815363
mod4 4932601
umuluu_or_0 5494690
umuluu_le 5803291
subsi 6117316
subri 6122277
truedivsi 6202031
affsi 6383251
mulrs 7181596
fractor 7376733
gc_NULL 7969599
cmpir 9428008
ugcdiu 10082594
cmpiu 10119031
cmpui 10119062
affectsign_safe 10736196
uabsdiviu_rem 11892741
addrs 12303872
smodss 12533558
rdivii 13100566
rdiviiz 13145590
mod8 13270449
mpabs_shallow 13428463
utor 13463116
affur 13463229
divii 14057869
subrs 16475630
dvdii 16549055
Fl_halve 18045681
modis 19638526
smodis 21176263
evalvalser 21527935
int_bit 22283365
hammingu 24045805
abscmpui 33060576
abscmpiu 33060688
mulri 38033997
mpexpo 38855558
absequaliu 39660738
absequalui 41409672
itos_or_0 43596213
Mod4 43774203
modsi 45225546
affui 45473825
Fl_div 46532020
stack_malloc 46641431
truedivii 46798542
umodi2n 49026742
sdivsi_rem 51429872
gc_bool 51989823
gc_ulong 52190405
affrr_fixlg 54646534
stack_malloc_align 55488954
absi_shallow 58113890
Fl_addmulmul_pre 60018214
mod2 61154424
minuu 69061418
remlll_pre 75538966
evalprecp 78668582
evalvalp 81625575
mpsqr 90971548
Fl_sqr 94903228
Fl_triple 95517090
addiu 96820273
addui 100470036
mod2BIL 103592058
fixlg 104143941
mpodd 115086609
icopyspec 117027682
togglesign_safe 125518150
real_1 129795636
subiu 131679225
subui 136664101
mpshift 153190980
dvmduBIL 165801898
itou 177094004
shiftr 177966446
addis 181597597
gc_double 184378395
vali 190343275
varncmp 217212140
gc_long 242067822
mpsub 251479507
utoineg 294170687
cgetineg 295028353
rtor 295259578
addsi 306783638
muliu 373496301
itos 462039273
mulis 463152125
shiftr_inplace 463809029
Fl_double 470099784
real_0_bit 479012609
addir 479879976
affsr 486066605
stor 486361947
mpadd 574224813
negi 636718178
itor 713149266
Fl_neg 716651772
umodsu 724227085
stoi 772538119
expu 775303388
lg2prec 797919820
mpmul 837281274
rcopy 902734692
affii 909112533
mpneg 916654401
subrr 1000069347
cgetg_copy 1479769956
cmpuu 1492601218
cgetr 1838470529
togglesign 1910985500
minss 2008403667
absi 2060422745
mpabs 2131211381
Fl_sqr_pre 2155384062
setabssign 2197897827
nbits2lg 2362542815
Fl_mul 2415935732
expi 2453076534
addrr 2875507434
remii 3012902771
adduu 3412280616
stackdummy 3644587577
Fl_mul_pre 4080980436
Fl_add 4380161519
leafcopy 4964775111
shift_right 5625899282
dvmdsBIL 7013980202
Fl_sub 7293565552
Fl_addmul_pre 7650900241
subii 7664527092
shift_left 7682851157
uutoi 8809977903
icopy 9056834377
maxss 9730424035
utoi 11902439296
addii 12407537662
evalexpo 13123894974
utoipos 14146474279
gc_const 15513966334
cgetipos 16304709798
cgetg 24533712185
cgeti 27128186361
new_chunk 93245585476
evallg 95216039678
set_avma 128982311479

Generated by: LCOV version 1.16