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 31092-e6893b0017) Lines: 88.6 % 690 611
Test Date: 2026-08-12 17:02:34 Functions: 89.9 % 247 222
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
Fl_add 6561754349
Fl_addmul_pre 8206606027
Fl_addmulmul_pre 74215988
Fl_center 4490059
Fl_div 49583544
Fl_double 521740588
Fl_ellj_pre 242732
Fl_halve 20603716
Fl_mul 2548214147
Fl_mul_pre 4450321103
Fl_neg 741550242
Fl_sqr 108111605
Fl_sqr_pre 2568713236
Fl_sub 7678432829
Fl_triple 100222422
Mod16 389809
Mod2 3595514
Mod32 311157
Mod4 50720250
Mod64 0
Mod8 3309346
abscmpiu 31885864
abscmpui 31885864
absequaliu 45906154
absequalui 47655924
absi 2076483831
absi_shallow 59949371
absr 20510
absrnz_equal1 4559239
absrnz_equal2n 1580211
addii 13116704128
addir 490366208
addis 195806567
addiu 100514794
addri 1113223
addrr 3030978587
addrs 12387748
addsi 320995285
addss 25081
addui 104589365
adduu 3539456148
affectsign 0
affectsign_safe 10754704
affii 1002994388
affrr_fixlg 56699541
affsi 6485058
affsr 509055124
affui 47976646
affur 13344796
ceildivuu 3918923
cgetg 28012434519
cgetg_block 430408
cgetg_copy 1490932901
cgeti 28637534963
cgetineg 301594682
cgetipos 16897826882
cgetr 192137240
cgetr_block 44729
cmpir 1730060
cmpis 6119308
cmpiu 12999791
cmpri 303856
cmprs 40996
cmpsi 6351307
cmpsr 796228
cmpss 1416201
cmpui 12999791
cmpuu 318397318
divii 16305888
divmpr 3759
divrmp 1203034
divsi_rem 0
divss 0
divss_rem 0
dvdii 17072537
dvdiiz 0
dvdis 33765
dvdisz 0
dvdiu 576287
dvdiuz 0
dvdsi 371
dvdui 167545
dvmdis 0
dvmdsBIL 7387580479
dvmdsi 0
dvmdss 0
dvmduBIL 173044520
equalis 1149809
equaliu 3042330
equalsi 1149991
equalui 3042330
evalexpo 13969886198
evallg 100055268910
evalprecp 78703524
evalvalp 81660127
evalvalser 25309350
expi 2476412047
expu 955703388
fixlg 106530840
fractor 7387947
fractor_lg 7389438
gc_NULL 7913051
gc_bool 55264300
gc_const 15931558838
gc_double 199001809
gc_int 2818775
gc_long 243067618
gc_stoi 155898
gc_ulong 52325565
gc_utoi 467851
gc_utoipos 1155326
get_avma 0
hammingu 24078697
icopy 9395981512
icopyspec 120487070
int_bit 21042606
itor 451912507
itor_lg 739882528
itos 477891146
itos_or_0 44914252
itou 180921647
itou_or_0 5015374
leafcopy 5280184250
lg2prec 30275463
maxdd 3218486
maxss 7461363777
maxuu 6603108
mindd 265751
minss 2044826384
minuu 57568843
mod16 308662
mod2 65901891
mod2BIL 113534840
mod32 259
mod4 7594956
mod64 0
mod8 15673270
modis 19638526
modsi 45242231
modss 0
mpabs 2118559334
mpabs_shallow 13428274
mpadd 598063056
mpceil 0
mpcmp 2164580
mpcopy 665
mpdiv 0
mpexpo 37846076
mpfloor 0
mpmul 889619145
mpneg 952078242
mpodd 118264321
mpround 1216187
mpshift 153980842
mpsqr 91850257
mpsub 273976419
mptrunc 49
mulis 470853662
muliu 379052680
mulri 53835785
mulrs 7181596
mulru 2765059
nbits2lg 1676163757
negi 661636110
negr 3961172
new_chunk 98638403802
newblock 857713
rcopy 1101981457
rdivii 5744766
rdivii_lg 13134330
rdiviiz 13173957
rdivis 0
rdivsi 0
rdivss 839647
real2n 1070112
real_0 1160928
real_0_bit 499107444
real_1 133395693
real_1_bit 4699384
real_m1 455
real_m2n 126
remii 3105329223
remis 0
remlll_pre 79167996
remsi 0
remss 0
rtor 308826692
rtor_lg 308831046
sdivsi 102165
sdivsi_rem 51446845
sdivss_rem 0
set_avma 136020143950
setabssign 2187224529
shift_left 7847899586
shift_right 5948007776
shiftl 0
shiftlr 0
shiftr 363969834
shiftr_inplace 472701705
smodis 21176116
smodss 13998082
stack_calloc 110622
stack_calloc_align 3325
stack_malloc 46736567
stack_malloc_align 55671572
stackdummy 3735144499
stoi 776333128
stor 2140783
stor_lg 509055124
subii 8009851675
subir 3030784
subis 171754
subiu 133454455
subri 1538306
subrr 1062996508
subrs 16573512
subsi 6244514
subss 25081
subui 138449777
subuu 25081
thuemorseu 3311
togglesign 1996703390
togglesign_safe 157552341
truedivii 54929595
truedivis 268442
truedivsi 6202318
uabsdiviu_rem 26737503
uabsdivui_rem 128885
udivuu_rem 2418435
ugcdiu 10312784
ugcdui 2737
umodi2n 58326174
umodsu 734456291
umodui 710986
umuluu_le 7618608
umuluu_or_0 6342977
utoi 12424879820
utoineg 300671920
utoipos 14658964893
utor 13344656
utor_lg 13344656
uutoi 9223950216
uutoineg 365874
vali 194756813
varncmp 218513288
varnmax 203
varnmin 26180

Generated by: LCOV version 2.0-1