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 30640-c2c58e18c5) Lines: 605 680 89.0 %
Date: 2026-01-27 08:51:18 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 33709
cmprs 40996
cgetr_block 42037
sdivsi 102151
stack_calloc 102847
gc_stoi 155797
dvdui 167195
subis 170920
truedivis 220264
Fl_ellj_pre 238059
mod16 241110
mindd 252016
cmpri 282310
Mod32 311108
uutoineg 362505
Mod16 389703
cgetg_block 417995
gc_utoi 431041
dvdiu 574416
mpdiv 614619
cmpsr 669840
gc_utoipos 838253
rdivss 839647
addri 910913
real2n 948731
equalis 1008312
equalsi 1008494
real_0 1047799
mpround 1123243
absrnz_equal2n 1249312
umodui 1296276
cmpss 1379853
mpcmp 1990439
Mod8 2073547
Mod2 2369854
udivuu_rem 2413217
gc_int 2629335
mulru 2765892
equaliu 2788390
equalui 2788392
maxdd 2872447
subir 2943420
itou_or_0 3041369
ceildivuu 3548420
cmpis 3616359
negr 3652673
cmpsi 3848359
real_1_bit 4295443
absrnz_equal1 4352934
Fl_center 4469019
maxuu 4809325
umuluu_or_0 5065632
mod4 5082759
subri 5315593
umuluu_le 5803291
affsi 5848604
subsi 6093478
truedivsi 6202031
mulrs 7181596
fractor 7372138
gc_NULL 7468471
cmpir 8376702
affectsign_safe 9905542
ugcdiu 10094117
cmpiu 10105373
cmpui 10105406
addrs 11862212
uabsdiviu_rem 11892741
smodss 12519995
rdivii 13077726
rdiviiz 13121939
mod8 13162045
utor 13199821
affur 13199936
mpabs_shallow 13428463
divii 13808673
dvdii 14782128
subrs 15574998
Fl_halve 18503572
modis 19638526
int_bit 20981179
smodis 21176060
evalvalser 21527935
hammingu 23932588
abscmpiu 32425790
abscmpui 32425839
mpexpo 37438810
mulri 38006873
absequaliu 39407180
absequalui 41156065
Mod4 42598191
itos_or_0 43190631
truedivii 43914698
modsi 45223663
affui 45420155
stack_malloc 45605637
Fl_div 46055835
gc_bool 47217393
umodi2n 47740739
stack_malloc_align 49441588
gc_ulong 50278477
sdivsi_rem 51427990
affrr_fixlg 53626535
mod2 54626918
absi_shallow 57228431
Fl_addmulmul_pre 64659301
minuu 66699765
remlll_pre 73762812
evalprecp 78668457
evalvalp 81625606
mpsqr 86898612
Fl_triple 94147857
Fl_sqr 94608666
addiu 95062166
mod2BIL 96713330
addui 98238727
mpodd 101934349
fixlg 102685724
icopyspec 103253199
subiu 109320759
subui 114182186
togglesign_safe 122966488
real_1 123140473
mpshift 135441178
dvmduBIL 161741711
gc_double 170532475
shiftr 171147619
addis 172988081
itou 175460660
vali 185936465
varncmp 215404720
gc_long 239874740
mpsub 241177874
utoineg 276574079
cgetineg 277381748
rtor 278542712
addsi 298172260
muliu 366227333
real_0_bit 443558329
shiftr_inplace 453583214
itos 454730365
mulis 459562602
addir 462727677
Fl_double 463794322
affsr 476992334
stor 477285412
mpadd 545409369
negi 589580118
itor 677851104
Fl_neg 708591275
umodsu 723907293
expu 749975426
stoi 767765646
lg2prec 776231611
affii 794581032
mpmul 797931256
mpneg 809437477
rcopy 861211330
subrr 926829151
cgetg_copy 1401254076
cmpuu 1466614396
togglesign 1754079949
cgetr 1763407045
minss 1869956828
absi 1975745897
mpabs 2037773356
setabssign 2103580641
Fl_sqr_pre 2143859350
nbits2lg 2258907419
expi 2279109780
Fl_mul 2391604136
addrr 2712640660
remii 2887670987
adduu 3241301978
stackdummy 3349622268
Fl_mul_pre 4035210425
Fl_add 4336121836
leafcopy 4661181636
shift_right 5371776778
dvmdsBIL 6617089456
Fl_sub 6930016876
shift_left 7360406777
subii 7404059699
Fl_addmul_pre 7601478515
uutoi 8503357538
icopy 8809556270
maxss 9325122452
utoi 11412545892
addii 11972396736
evalexpo 12490187260
utoipos 13607705636
gc_const 14522142259
cgetipos 15687461295
cgetg 23081357934
cgeti 26241858714
new_chunk 88644893143
evallg 90486585561
set_avma 122426735807

Generated by: LCOV version 1.16