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: 1610 1786 90.1 %
Date: 2026-05-06 09:26:47 Functions: 97 107 90.7 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
FpM_echelon 3365684
FpM_hnfend 3365974
FpV_Fp_mul_part_ip 5413475
FpV_red_part_ipvec 37729660
Minus 2994685
RgC_elem 511
RgM_hnfall 42
RgM_reduce 84
RgXM_snf 49
ZC_elem 41263399
ZC_lincomb1z 29903735
ZC_lincomb1z_i 29923831
ZM_hnf 90351
ZM_hnf_knapsack 238
ZM_hnfall 29336
ZM_hnfall_i 752613
ZM_hnfcenter 25174
ZM_hnfintersectmod 28
ZM_hnflll 309137
ZM_hnfmod 162636
ZM_hnfmodall 5142184
ZM_hnfmodall_i 5193303
ZM_hnfmodid 4539210
ZM_hnfmodprime 3365689
ZM_hnfperm 385
ZM_redpart 1689942
ZM_reduce 4475579
ZM_rowrankprofile 303621
ZM_snf 15925
ZM_snf_group 764366
ZM_snf_no_divide 1301872
ZM_snfall 64243
ZM_snfall_i 848059
ZM_snfclean 1081399
ZMrow_divexact_inplace 1070772
ZV_allequal 322723
ZV_extgcd 110579
ZV_gcdext_i 111783
ZV_hnfgcdext 1211
ZV_snf_group 316936
ZV_snf_rank 91
ZV_snf_rank_u 49
ZV_snf_trunc 0
ZV_snfall 316936
ZV_snfclean 227088
ZpM_echelon 528227
addmulzii 583192252
addzi 277115411
affii2_or_copy_gc 54235837
allhnfmod 438536
bezout_step 890629
col_dup 3769145
col_mul 3367782
count 10216686
count2 554673
do_zero 0
findi 128648108
findi_normalize 128625679
gbezout_step 882
gsmith 0
gsmithall 0
gsnf_no_divide 196
hnf 14
hnf_divscale 197528
hnf_i 62520
hnf_invimage 547538
hnf_invscale 275324
hnf_solve 461165
hnfadd 0
hnfadd_i 117257
hnfall 14
hnfallgen 21
hnfdivide 133
hnffinal 303622
hnflll 7
hnfmerge_get_1 815982
hnfmod 14
hnfmodid 438523
hnfperm 14
hnfspec 0
hnfspec_i 186355
hnfswap 11614522
is_RgX 2590
mathnf0 1477
mathnfspec 0
matsnf0 469
must_swap 6188716
negcmpii 602522
normalize_as_RgX 364
optimal_D 5191280
p_mat 0
reduce1 1013921
reduce2 64280876
remove_0cols 336566
reverse_rows 618243
smith 385
smithall 35
smithclean 693
snf_group 1081405
snf_pile 1123487
snf_pile1 48
snfrank 154
subzi 7909147
trivsmith 0
update 841971
zlm_echelon 4803807
zv_snf_rank 0

Generated by: LCOV version 1.16