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 31057-89c4d54ba6) Lines: 88.5 % 684 605
Test Date: 2026-07-25 17:02:42 Functions: 89.6 % 241 216
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
Fl_add 6560889298
Fl_addmul_pre 8205376296
Fl_addmulmul_pre 74216970
Fl_center 4490059
Fl_div 49580900
Fl_double 521085886
Fl_ellj_pre 242727
Fl_halve 20601712
Fl_mul 2549187408
Fl_mul_pre 4446396549
Fl_neg 741531997
Fl_sqr 108109315
Fl_sqr_pre 2564071095
Fl_sub 7690712949
Fl_triple 100072526
Mod16 389789
Mod2 3533481
Mod32 311157
Mod4 50400737
Mod64 0
Mod8 3247314
abscmpiu 32504243
abscmpui 32504243
absequaliu 45591159
absequalui 47340890
absi 2076261753
absi_shallow 60453734
absr 20510
absrnz_equal1 4559255
absrnz_equal2n 1580313
addii 13117840556
addir 490369225
addis 195197349
addiu 101495347
addri 1113219
addrr 3027871270
addrs 12387629
addsi 320386067
addss 25081
addui 105569911
adduu 3539255053
affectsign 0
affectsign_safe 10755613
affii 1002889126
affrr_fixlg 56699554
affsi 6484648
affsr 507932839
affui 47850644
affur 13344743
ceildivuu 3916562
cgetg 26262752955
cgetg_block 430325
cgetg_copy 1490605135
cgeti 28621967434
cgetineg 301062945
cgetipos 16891385902
cgetr 1945452014
cgetr_block 44735
cmpir 1730008
cmpis 5993299
cmpiu 12999233
cmpri 303854
cmprs 40996
cmpsi 6225298
cmpsr 796228
cmpss 1416201
cmpui 12999233
cmpuu 318021715
divii 15873510
divmpr 3759
divrmp 1202999
divsi_rem 0
divss 0
divss_rem 0
dvdii 17072241
dvdiiz 0
dvdis 33765
dvdisz 0
dvdiu 576287
dvdiuz 0
dvdsi 371
dvdui 167545
dvmdis 0
dvmdsBIL 7366331180
dvmdsi 0
dvmdss 0
dvmduBIL 171017887
equalis 1149708
equaliu 3042306
equalsi 1149890
equalui 3042306
evalexpo 13974231147
evallg 99996395323
evalprecp 78703518
evalvalp 81660121
evalvalser 25309350
expi 2487342941
expu 979981836
fixlg 106536892
fractor 7389438
gc_NULL 7910601
gc_bool 55260165
gc_const 15922209386
gc_double 199002361
gc_int 2818115
gc_long 243060931
gc_stoi 155903
gc_ulong 52319405
gc_utoi 467832
gc_utoipos 1155314
get_avma 0
hammingu 24078694
icopy 9368426671
icopyspec 119694536
int_bit 21041578
itor 752953736
itos 477718320
itos_or_0 44914134
itou 180892118
itou_or_0 4918356
leafcopy 5281944169
lg2prec 838610501
maxdd 3218243
maxss 7484356607
maxuu 6603110
mindd 265751
minss 2060320477
minuu 57545166
mod16 308662
mod2 65775414
mod2BIL 113284564
mod32 259
mod4 7470812
mod64 0
mod8 15673934
modis 19638526
modsi 45242201
modss 0
mpabs 2118336840
mpabs_shallow 13428280
mpadd 598046370
mpceil 0
mpcmp 2164535
mpcopy 665
mpdiv 0
mpexpo 37847454
mpfloor 0
mpmul 889647000
mpneg 951665849
mpodd 118263537
mpround 1216191
mpshift 153963601
mpsqr 91854031
mpsub 274020466
mptrunc 49
mulis 470653650
muliu 379268727
mulri 53048208
mulrs 7181596
mulru 2765059
nbits2lg 2516094678
negi 661235356
negr 3961206
new_chunk 98577724586
newblock 857553
rcopy 1105157179
rdivii 13134342
rdiviiz 13173969
rdivis 0
rdivsi 0
rdivss 839647
real2n 1070080
real_0 1160764
real_0_bit 499174518
real_1 143871513
real_1_bit 4698886
real_m1 455
real_m2n 126
remii 3103844603
remis 0
remlll_pre 79167991
remsi 0
remss 0
rtor 308816968
sdivsi 102165
sdivsi_rem 51446815
sdivss_rem 0
set_avma 135949556443
setabssign 2186911966
shift_left 7840899123
shift_right 5941314113
shiftl 0
shiftlr 0
shiftr 363704137
shiftr_inplace 472341371
smodis 21176116
smodss 13998082
stack_calloc 110611
stack_calloc_align 3325
stack_malloc 46711195
stack_malloc_align 55672160
stackdummy 3738016660
stoi 775990112
stor 507932839
subii 8000102895
subir 3030782
subis 171754
subiu 133454223
subri 14369777
subrr 1062227404
subrs 16573278
subsi 6244850
subss 25081
subui 138449507
subuu 25081
thuemorseu 3313
togglesign 1995756486
togglesign_safe 157520371
truedivii 54916009
truedivis 268432
truedivsi 6202318
uabsdiviu_rem 25949953
uabsdivui_rem 128889
udivuu_rem 2418435
ugcdiu 10312772
ugcdui 2737
umodi2n 57882576
umodsu 734418576
umodui 710986
umuluu_le 7618608
umuluu_or_0 6356936
utoi 12422753042
utoineg 300140181
utoipos 14655363735
utor 13344603
uutoi 9221684970
uutoineg 365874
vali 193225870
varncmp 218513205
varnmax 203
varnmin 26180

Generated by: LCOV version 2.0-1