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 - basemath - lll.c (source / functions) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31042-0fbe168e69) Lines: 81.3 % 1643 1335
Test Date: 2026-07-23 17:04:59 Functions: 96.2 % 131 126
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
Babai 0
Babai_dpe 4762323
Babai_fast 31670503
Babai_heuristic 301906
GS_extraprec 4729266
REDgen 196
RgM_Cholesky_dynprec 2988
RgM_flip 34939
RgM_flop 0
RgM_is_square_mat 45828
ZC_to_RC 22240
ZM2_lll_norms 4851314
ZM_flatter 627269
ZM_flatter_rank 625255
ZM_flattergram 968
ZM_flattergram_rank 968
ZM_is_knapsack 607647
ZM_is_lower 1205580
ZM_is_upper 4239602
ZM_lll_norms 7144245
ZM_to_RM 4692
absrsmall 761350
absrsmall2 441842
addmuliu2n 4642157
addmuliu642n 726330
addmuliu64_inplace 10599145
addmulziu 10701531
addmulzu2n 16967395
addzi 32045830
affdbldpe 3210438
affdpe 33062959
affidpe 22363572
affii_or_copy_gc 2162095
cget_dblmat 8430168
cget_dblvec 35109252
cget_dpemat 3210438
cget_dpevec 13316637
condition_bound 4729266
dbg_flatter 0
dbg_flattergram 0
dbldotproduct 129123782
dbldotsquare 2485309
dblrotate 35873628
do_SWAPgen 196
dpeM_diagonal_shallow 1694
dpe_abscmp 15746499
dpe_abssmall 2162095
dpe_addmuluz 1323853
dpe_addz 6613235
dpe_cmp 5469801
dpe_cmpmul 5469801
dpe_divz 15577747
dpe_muluz 8621596
dpe_mulz 74585258
dpe_negz 366301
dpe_normalize 76719052
dpe_normalize0 151968279
dpe_submuluz 1410109
dpe_submulz 69115457
dpe_subz 75767142
dperotate 716308
dpetor 25844
drop 1347830
flat 1347830
flattergram_i 2988
fplll 0
fplll_dpe 1605219
fplll_fast 2107542
fplll_flatter 626223
fplll_heuristic 4692
gc_lll 5446
get_cholesky 44546
get_gramschmidt 1099663
gramschmidt_dynprec 2695660
gramschmidt_upper 1402
incrementalGSgen 168
itodbl_exp 176918914
kerint 28
kerint0 56
lll 1244994
lll_finish 2168181
lll_trivial 771847
lllall 36699
lllallgen 168
lllfp 5375739
lllgen 42
lllgram 9089
lllgramallgen 168
lllgramgen 42
lllgramint 36439
lllgramkerim 35
lllgramkerimgen 42
lllint 183
lllkerim 35
lllkerimgen 42
matkerint0 28
mpabscmp 4109269
mulshift 933199
nbits2prec64 7496565
pari_rint 11638556
potential 1347830
pslg 504
qflll0 301
qflllgram 63
qflllgram0 245
realdotproduct 1288707
realsqrdotproduct 207602
rotate 33251056
rotateG 478734
rotateG_fast 11957876
setG2_fast 17608495
setG2_heuristic 194933
setG_fast 23262321
setG_heuristic 217683
set_line 25542035
sizered 1347830
spread 5856032
submuliu2n 4718260
submuliu642n 744684
submuliu64_inplace 10652343
submulshift 2066712
submulziu 12094839
submulzu2n 16768355
subzi 32809395
thre 1033915
thsn 92851
truncexpo 24411
u64toi 21996172
u64toineg 726330
update_alpha 12436610
vectail_inplace 2093562

Generated by: LCOV version 2.0-1