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-12-03 17:02:49 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 6563131026
Fl_addmul_pre 8209491631
Fl_addmulmul_pre 74217220
Fl_center 4490059
Fl_div 49578040
Fl_double 521746218
Fl_ellj_pre 242728
Fl_halve 20608587
Fl_mul 2549586481
Fl_mul_pre 4453357625
Fl_neg 741599315
Fl_sqr 108126891
Fl_sqr_pre 2569463667
Fl_sub 7686416275
Fl_triple 100213191
Mod16 389809
Mod2 3595514
Mod32 311157
Mod4 50721479
Mod64 0
Mod8 3309346
abscmpiu 32547947
abscmpui 32547947
absequaliu 45906183
absequalui 47655953
absi 2076494958
absi_shallow 60611542
absr 20510
absrnz_equal1 4559292
absrnz_equal2n 1580237
addii 13116258808
addir 490373050
addis 195797399
addiu 101837860
addri 1113223
addrr 3031006655
addrs 12387734
addsi 320986117
addss 25081
addui 105912433
adduu 3540937073
affectsign 0
affectsign_safe 10754273
affii 1002910620
affrr_fixlg 56699565
affsi 6484553
affsr 509055882
affui 47976646
affur 13344729
ceildivuu 3917834
cgetg 28022123550
cgetg_block 430408
cgetg_copy 1490916130
cgeti 28635015043
cgetineg 301591208
cgetipos 16901187860
cgetr 192137054
cgetr_block 44740
cmpir 1730019
cmpis 6119309
cmpiu 13000003
cmpri 303857
cmprs 40996
cmpsi 6351308
cmpsr 796228
cmpss 1416201
cmpui 13000003
cmpuu 318393731
divii 16307019
divmpr 3759
divrmp 1203052
divsi_rem 0
divss 0
divss_rem 0
dvdii 17072521
dvdiiz 0
dvdis 33765
dvdisz 0
dvdiu 576287
dvdiuz 0
dvdsi 371
dvdui 167545
dvmdis 0
dvmdsBIL 7387481161
dvmdsi 0
dvmdss 0
dvmduBIL 173317724
equalis 1149754
equaliu 3042343
equalsi 1149936
equalui 3042343
evalexpo 13969988139
evallg 100067911147
evalprecp 78703552
evalvalp 81660155
evalvalser 25309350
expi 2476620772
expu 955687761
fixlg 106530783
fractor 7387946
fractor_lg 7389437
gc_NULL 7912314
gc_bool 55260577
gc_const 15930110141
gc_double 199008729
gc_int 2818776
gc_long 243067764
gc_stoi 155897
gc_ulong 52345489
gc_utoi 467830
gc_utoipos 1155352
get_avma 0
hammingu 24078801
icopy 9395931693
icopyspec 120487259
int_bit 21007603
itor 451943604
itor_lg 739909082
itos 477885445
itos_or_0 44914221
itou 180921781
itou_or_0 5015388
leafcopy 5280275132
lg2prec 30274166
maxdd 3218011
maxss 7468769865
maxuu 6603113
mindd 265751
minss 2045050470
minuu 57521950
mod16 308662
mod2 65903013
mod2BIL 113536101
mod32 259
mod4 7594956
mod64 0
mod8 15673457
modis 19638526
modsi 45242147
modss 0
mpabs 2118566002
mpabs_shallow 13428274
mpadd 598133726
mpceil 0
mpcmp 2164534
mpcopy 665
mpdiv 0
mpexpo 37848030
mpfloor 0
mpmul 889755012
mpneg 952105606
mpodd 118266293
mpround 1216172
mpshift 153955314
mpsqr 91857644
mpsub 274037228
mptrunc 49
mulis 470872411
muliu 378841929
mulri 53835785
mulrs 7181596
mulru 2765059
nbits2lg 1676281194
negi 661683107
negr 3961175
new_chunk 98649526236
newblock 857724
rcopy 1101970799
rdivii 5744801
rdivii_lg 13134364
rdiviiz 13173991
rdivis 0
rdivsi 0
rdivss 839647
real2n 1070074
real_0 1160902
real_0_bit 499094427
real_1 133393284
real_1_bit 4698947
real_m1 455
real_m2n 126
remii 3103941272
remis 0
remlll_pre 79168015
remsi 0
remss 0
rtor 308817366
rtor_lg 308821720
sdivsi 102165
sdivsi_rem 51446761
sdivss_rem 0
set_avma 136034035177
setabssign 2187231602
shift_left 7847978254
shift_right 5948064287
shiftl 0
shiftlr 0
shiftr 363957510
shiftr_inplace 472694504
smodis 21176116
smodss 13998082
stack_calloc 110670
stack_calloc_align 3325
stack_malloc 46736596
stack_malloc_align 55673782
stackdummy 3739223802
stoi 776236702
stor 2140785
stor_lg 509055882
subii 8008634738
subir 3030792
subis 171754
subiu 133454681
subri 1538295
subrr 1063022771
subrs 16573314
subsi 6244736
subss 25081
subui 138450019
subuu 25081
thuemorseu 3311
togglesign 1996707038
togglesign_safe 157521988
truedivii 54924724
truedivis 268433
truedivsi 6202318
uabsdiviu_rem 26737503
uabsdivui_rem 128885
udivuu_rem 2418435
ugcdiu 10312783
ugcdui 2737
umodi2n 58327403
umodsu 734435237
umodui 710986
umuluu_le 7618608
umuluu_or_0 6378586
utoi 12428161410
utoineg 300668449
utoipos 14662221688
utor 13344589
utor_lg 13344589
uutoi 9225643936
uutoineg 365874
vali 194758720
varncmp 218513253
varnmax 203
varnmin 26180

Generated by: LCOV version 2.0-1