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.19.0 lcov report (development 31057-89c4d54ba6) Lines: 81.3 % 1643 1335
Test Date: 2026-07-25 17:02:42 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 4767812
Babai_fast 31686245
Babai_heuristic 303121
GS_extraprec 4729082
REDgen 196
RgM_Cholesky_dynprec 2988
RgM_flip 34953
RgM_flop 0
RgM_is_square_mat 45828
ZC_to_RC 22450
ZM2_lll_norms 4851097
ZM_flatter 627253
ZM_flatter_rank 625239
ZM_flattergram 968
ZM_flattergram_rank 968
ZM_is_knapsack 607699
ZM_is_lower 1205612
ZM_is_upper 4239579
ZM_lll_norms 7144116
ZM_to_RM 4708
absrsmall 763551
absrsmall2 443564
addmuliu2n 4665716
addmuliu642n 729530
addmuliu64_inplace 10613308
addmulziu 10826608
addmulzu2n 17070592
addzi 32506304
affdbldpe 3210516
affdpe 33168987
affidpe 22440775
affii_or_copy_gc 2183608
cget_dblmat 8430520
cget_dblvec 35114172
cget_dpemat 3210516
cget_dpevec 13317586
condition_bound 4729082
dbg_flatter 0
dbg_flattergram 0
dbldotproduct 129239865
dbldotsquare 2485021
dblrotate 35887821
do_SWAPgen 196
dpeM_diagonal_shallow 1736
dpe_abscmp 15813472
dpe_abssmall 2183608
dpe_addmuluz 1345057
dpe_addz 6685223
dpe_cmp 5479896
dpe_cmpmul 5479896
dpe_divz 15649791
dpe_muluz 8704420
dpe_mulz 75179058
dpe_negz 366754
dpe_normalize 77498429
dpe_normalize0 153390448
dpe_submuluz 1433660
dpe_submulz 69699162
dpe_subz 76424967
dperotate 718506
dpetor 26670
drop 1347799
flat 1347799
flattergram_i 2988
fplll 0
fplll_dpe 1605258
fplll_fast 2107630
fplll_flatter 626207
fplll_heuristic 4708
gc_lll 5462
get_cholesky 44546
get_gramschmidt 1099660
gramschmidt_dynprec 2695598
gramschmidt_upper 1402
incrementalGSgen 168
itodbl_exp 177117102
kerint 28
kerint0 56
lll 1244994
lll_finish 2168269
lll_trivial 771848
lllall 36699
lllallgen 168
lllfp 5375646
lllgen 42
lllgram 9089
lllgramallgen 168
lllgramgen 42
lllgramint 36439
lllgramkerim 35
lllgramkerimgen 42
lllint 183
lllkerim 35
lllkerimgen 42
matkerint0 28
mpabscmp 4109596
mulshift 938306
nbits2prec64 7496447
pari_rint 11658535
potential 1347799
pslg 504
qflll0 301
qflllgram 63
qflllgram0 245
realdotproduct 1292770
realsqrdotproduct 208573
rotate 33266134
rotateG 480369
rotateG_fast 11962607
setG2_fast 17618216
setG2_heuristic 195857
setG_fast 23273174
setG_heuristic 218718
set_line 25553157
sizered 1347799
spread 5855913
submuliu2n 4739476
submuliu642n 747684
submuliu64_inplace 10666132
submulshift 2074370
submulziu 12229364
submulzu2n 16867897
subzi 33271482
thre 1033979
thsn 92852
truncexpo 24470
u64toi 22027124
u64toineg 729530
update_alpha 12442976
vectail_inplace 2093650

Generated by: LCOV version 2.0-1