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 30703-cd958ce78c) Lines: 605 680 89.0 %
Date: 2026-02-23 09:22:43 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 14728
uabsdivui_rem 16693
addss 25067
subss 25067
subuu 25067
dvdis 33723
cmprs 40996
cgetr_block 43800
sdivsi 102148
stack_calloc 110380
gc_stoi 155884
dvdui 167195
subis 170918
Fl_ellj_pre 238041
mod16 241094
mindd 264337
truedivis 266943
cmpri 282310
Mod32 311108
uutoineg 363748
Mod16 389733
cgetg_block 424950
gc_utoi 468665
dvdiu 576269
mpdiv 665644
cmpsr 796090
rdivss 839647
real2n 1067079
addri 1106220
equalis 1151070
equalsi 1151252
gc_utoipos 1153471
real_0 1156510
mpround 1216590
umodui 1290981
absrnz_equal2n 1292611
cmpss 1392943
Mod8 2074190
mpcmp 2226367
Mod2 2370296
udivuu_rem 2418330
gc_int 2631196
mulru 2765892
subir 3005092
equalui 3018266
equaliu 3018269
itou_or_0 3041705
maxdd 3178617
cmpis 3633378
negr 3671726
cmpsi 3865381
ceildivuu 3903806
Fl_center 4486195
absrnz_equal1 4519928
real_1_bit 4705123
maxuu 4814744
mod4 5085259
umuluu_or_0 5512850
umuluu_le 5803291
subsi 6094005
subri 6132471
truedivsi 6202031
affsi 6373461
mulrs 7181596
fractor 7376925
gc_NULL 7962965
cmpir 9434552
ugcdiu 10114467
cmpui 10131521
cmpiu 10131722
affectsign_safe 10728710
uabsdiviu_rem 11892741
addrs 12305056
smodss 12644403
rdivii 13103952
rdiviiz 13146166
mod8 13161266
mpabs_shallow 13428463
utor 13462009
affur 13462063
divii 14066057
subrs 16476025
dvdii 16563553
Fl_halve 18823087
modis 19638526
int_bit 20995656
smodis 21176074
evalvalser 21529076
hammingu 24048394
abscmpui 32364170
abscmpiu 32364184
mulri 38033932
mpexpo 38874972
absequaliu 39398473
absequalui 41146917
itos_or_0 43601025
Mod4 43798289
modsi 45225722
affui 45473823
Fl_div 46528237
stack_malloc 46643495
truedivii 47030518
umodi2n 48942220
sdivsi_rem 51430062
gc_bool 51990148
gc_ulong 52063226
affrr_fixlg 54654575
stack_malloc_align 55501176
absi_shallow 57949653
mod2 61131856
Fl_addmulmul_pre 64702710
minuu 69119594
remlll_pre 75968809
evalprecp 78675013
evalvalp 81631471
Fl_triple 91002299
mpsqr 91027458
Fl_sqr 95911621
addiu 96709614
addui 100353086
mod2BIL 103341358
fixlg 104198347
mpodd 115076388
icopyspec 117470390
togglesign_safe 125509955
real_1 129819600
subiu 131919557
subui 136892525
mpshift 153230697
dvmduBIL 159032701
shiftr 177977033
itou 178276747
addis 181565218
gc_double 184185414
vali 190383820
varncmp 217198302
gc_long 242455325
mpsub 251561216
utoineg 286070500
cgetineg 286931983
rtor 295265290
addsi 306749647
muliu 375721340
Fl_double 451518869
itos 462160449
shiftr_inplace 464452234
mulis 466278045
real_0_bit 479425308
addir 481442722
affsr 486222186
stor 486545976
mpadd 574541740
negi 636823083
itor 715114313
Fl_neg 723663432
umodsu 734163173
stoi 772411169
expu 775459763
lg2prec 800185507
mpmul 837765985
rcopy 903294138
affii 910843667
mpneg 916771320
subrr 1000248648
cgetg_copy 1479950415
cmpuu 1493846186
cgetr 1840653756
togglesign 1899100248
minss 2009963398
absi 2067323454
mpabs 2138120754
Fl_sqr_pre 2154880610
setabssign 2204811017
nbits2lg 2367165606
expi 2379104976
Fl_mul 2421287234
addrr 2877973389
remii 3008595202
adduu 3388276530
stackdummy 3631985790
Fl_mul_pre 4086316339
Fl_add 4395014549
leafcopy 4974125277
shift_right 5632387551
dvmdsBIL 7001709902
Fl_sub 7217399286
subii 7638202901
Fl_addmul_pre 7662104362
shift_left 7674951465
uutoi 8759628546
icopy 9022499056
maxss 9655477372
utoi 11831044919
addii 12368867518
evalexpo 13141303473
utoipos 14003118716
gc_const 15497337715
cgetipos 16165993949
cgetg 24523136047
cgeti 26936569561
new_chunk 92962756532
evallg 94920106064
set_avma 128663319625

Generated by: LCOV version 1.16