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 - hnf_snf.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30862-ea47bd413c) Lines: 1612 1786 90.3 %
Date: 2026-05-05 09:26:54 Functions: 97 107 90.7 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
ZV_snf_trunc 0
do_zero 0
gsmith 0
gsmithall 0
hnfadd 0
hnfspec 0
mathnfspec 0
p_mat 0
trivsmith 0
zv_snf_rank 0
hnflll 7
hnf 14
hnfall 14
hnfmod 14
hnfperm 14
hnfallgen 21
ZM_hnfintersectmod 28
smithall 35
RgM_hnfall 42
snf_pile1 48
RgXM_snf 49
ZV_snf_rank_u 49
RgM_reduce 84
ZV_snf_rank 91
hnfdivide 133
snfrank 154
gsnf_no_divide 196
ZM_hnf_knapsack 238
normalize_as_RgX 364
ZM_hnfperm 385
smith 385
matsnf0 469
RgC_elem 511
smithclean 693
gbezout_step 882
ZV_hnfgcdext 1211
mathnf0 1477
is_RgX 2590
ZM_snf 15925
ZM_hnfcenter 25174
ZM_hnfall 29333
hnf_i 62507
ZM_snfall 64246
ZM_hnf 90335
ZV_extgcd 110579
ZV_gcdext_i 111783
hnfadd_i 117230
ZM_hnfmod 162637
hnfspec_i 186365
hnf_divscale 197516
ZV_snfclean 227084
hnf_invscale 275325
ZM_rowrankprofile 303600
hnffinal 303600
ZM_hnflll 309116
ZV_snf_group 316938
ZV_snfall 316938
ZV_allequal 322719
remove_0cols 336545
hnfmodid 438525
allhnfmod 438539
hnf_solve 461152
ZpM_echelon 528226
hnf_invimage 547539
count2 554757
negcmpii 602520
reverse_rows 618186
ZM_hnfall_i 752608
ZM_snf_group 764407
hnfmerge_get_1 815987
update 841871
ZM_snfall_i 848122
bezout_step 890515
reduce1 1013921
ZMrow_divexact_inplace 1070771
ZM_snfclean 1081404
snf_group 1081413
snf_pile 1123482
ZM_snf_no_divide 1301766
ZM_redpart 1689626
Minus 2994610
FpM_echelon 3365704
ZM_hnfmodprime 3365727
FpM_hnfend 3365951
col_mul 3367405
col_dup 3769096
ZM_reduce 4475524
ZM_hnfmodid 4539066
zlm_echelon 4803776
ZM_hnfmodall 5142015
optimal_D 5191324
ZM_hnfmodall_i 5193131
FpV_Fp_mul_part_ip 5413483
must_swap 6189759
subzi 7910889
count 10215287
hnfswap 11615939
ZC_lincomb1z 29905197
ZC_lincomb1z_i 29927463
FpV_red_part_ipvec 37729503
ZC_elem 41263675
affii2_or_copy_gc 54227847
reduce2 64288137
findi_normalize 128641868
findi 128665953
addzi 277039524
addmulzii 583249891

Generated by: LCOV version 1.16