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) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30762-238ab8e6c0) Lines: 1336 1642 81.4 %
Date: 2026-03-22 09:27:12 Functions: 125 130 96.2 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Babai 0
Babai_dpe 4656303
Babai_fast 30142512
Babai_heuristic 288770
GS_extraprec 4727353
REDgen 196
RgM_Cholesky_dynprec 2967
RgM_flip 34918
RgM_flop 0
RgM_is_square_mat 45828
ZC_to_RC 15945
ZM2_lll_norms 4848316
ZM_flatter 626872
ZM_flatter_rank 624858
ZM_flattergram 961
ZM_flattergram_rank 961
ZM_is_knapsack 606454
ZM_is_lower 1205512
ZM_is_upper 4236825
ZM_lll_norms 7138096
ZM_to_RM 4244
absrsmall 696466
absrsmall2 401466
addmuliu2n 4087158
addmuliu642n 668118
addmuliu64_inplace 9567280
addmulziu 4580751
addmulzu2n 271563
addzi 17783459
affdbldpe 3207851
affdpe 25733177
affidpe 20756946
affii_or_copy_gc 1390422
cget_dblmat 8418097
cget_dblvec 34996715
cget_dpemat 3207850
cget_dpevec 13301553
condition_bound 4727353
dbg_flatter 0
dbg_flattergram 0
dbldotproduct 118020362
dbldotsquare 2482541
dblrotate 34547735
do_SWAPgen 196
dpeM_diagonal_shallow 20139
dpe_abscmp 14518824
dpe_abssmall 1390428
dpe_addmuluz 342907
dpe_addz 1943118
dpe_cmp 5264610
dpe_cmpmul 5264605
dpe_divz 14078421
dpe_muluz 799874
dpe_mulz 56967042
dpe_negz 244392
dpe_normalize 48111563
dpe_normalize0 108571526
dpe_submuluz 412417
dpe_submulz 51702532
dpe_subz 53733650
dperotate 652350
dpetor 93772
drop 1347059
flat 1347060
flattergram_i 2967
fplll 0
fplll_dpe 1603926
fplll_fast 2104529
fplll_flatter 625818
fplll_heuristic 4244
gc_lll 4833
get_gaussred 44539
get_gramschmidt 1099295
gramschmidt_dynprec 2694118
gramschmidt_upper 1336
gsisinv 5195539
incrementalGSgen 168
itodbl_exp 162347737
kerint 28
kerint0 56
lll 1243424
lll_finish 2165140
lll_trivial 771777
lllall 36699
lllallgen 168
lllfp 5371380
lllgen 42
lllgram 9089
lllgramallgen 168
lllgramgen 42
lllgramint 36439
lllgramkerim 35
lllgramkerimgen 42
lllint 183
lllkerim 35
lllkerimgen 42
matkerint0 28
mpabscmp 4096444
mulshift 317610
nbits2prec64 7492706
pari_rint 10768993
potential 1347059
pslg 504
qflll0 301
qflllgram 63
qflllgram0 245
realdotproduct 1183370
realsqrdotproduct 197413
rotate 31872143
rotateG 443224
rotateG_fast 11515924
setG2_fast 16984338
setG2_heuristic 187610
setG_fast 22614910
setG_heuristic 205626
set_line 24887014
sizered 1347060
spread 5852888
submuliu2n 4173825
submuliu642n 683445
submuliu64_inplace 9625761
submulshift 1499787
submulziu 5923385
submulzu2n 262549
subzi 18525001
truncexpo 12138
u64toi 19876486
u64toineg 668118
update_alpha 11959193
vectail_inplace 2090970

Generated by: LCOV version 1.16