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
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 29336
hnf_i 62520
ZM_snfall 64243
ZM_hnf 90351
ZV_extgcd 110579
ZV_gcdext_i 111783
hnfadd_i 117257
ZM_hnfmod 162636
hnfspec_i 186355
hnf_divscale 197528
ZV_snfclean 227088
hnf_invscale 275324
ZM_rowrankprofile 303621
hnffinal 303622
ZM_hnflll 309137
ZV_snf_group 316936
ZV_snfall 316936
ZV_allequal 322723
remove_0cols 336566
hnfmodid 438523
allhnfmod 438536
hnf_solve 461165
ZpM_echelon 528227
hnf_invimage 547538
count2 554673
negcmpii 602522
reverse_rows 618243
ZM_hnfall_i 752613
ZM_snf_group 764366
hnfmerge_get_1 815982
update 841971
ZM_snfall_i 848059
bezout_step 890629
reduce1 1013921
ZMrow_divexact_inplace 1070772
ZM_snfclean 1081399
snf_group 1081405
snf_pile 1123487
ZM_snf_no_divide 1301872
ZM_redpart 1689942
Minus 2994685
FpM_echelon 3365684
ZM_hnfmodprime 3365689
FpM_hnfend 3365974
col_mul 3367782
col_dup 3769145
ZM_reduce 4475579
ZM_hnfmodid 4539210
zlm_echelon 4803807
ZM_hnfmodall 5142184
optimal_D 5191280
ZM_hnfmodall_i 5193303
FpV_Fp_mul_part_ip 5413475
must_swap 6188716
subzi 7909147
count 10216686
hnfswap 11614522
ZC_lincomb1z 29903735
ZC_lincomb1z_i 29923831
FpV_red_part_ipvec 37729660
ZC_elem 41263399
affii2_or_copy_gc 54235837
reduce2 64280876
findi_normalize 128625679
findi 128648108
addzi 277115411
addmulzii 583192252

Generated by: LCOV version 1.16