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) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31092-e6893b0017) Lines: 90.2 % 1787 1611
Test Date: 2026-10-12 17:03:14 Functions: 90.7 % 107 97
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
FpM_echelon 3366413
FpM_hnfend 3366413
FpV_Fp_mul_part_ip 5411932
FpV_red_part_ipvec 37981395
Minus 2997694
RgC_elem 511
RgM_hnfall 42
RgM_reduce 84
RgXM_snf 49
ZC_elem 41514204
ZC_lincomb1z 30071886
ZC_lincomb1z_i 30071886
ZM_hnf 90244
ZM_hnf_knapsack 238
ZM_hnfall 29114
ZM_hnfall_i 752449
ZM_hnfcenter 25384
ZM_hnfintersectmod 28
ZM_hnflll 309340
ZM_hnfmod 159548
ZM_hnfmodall 5170668
ZM_hnfmodall_i 5221907
ZM_hnfmodid 4570599
ZM_hnfmodprime 3366413
ZM_hnfperm 385
ZM_redpart 1690625
ZM_reduce 4462819
ZM_rowrankprofile 303824
ZM_snf 16184
ZM_snf_group 764698
ZM_snf_no_divide 1302012
ZM_snfall 64246
ZM_snfall_i 848677
ZM_snfclean 1081645
ZMrow_divexact_inplace 1071270
ZV_allequal 322729
ZV_extgcd 110579
ZV_gcdext_i 111734
ZV_hnfgcdext 1162
ZV_snf_group 316947
ZV_snf_rank 91
ZV_snf_rank_u 49
ZV_snf_trunc 0
ZV_snfall 316947
ZV_snfclean 227101
ZpM_echelon 529497
addmulzii 592103926
addzi 283852000
affii2_or_copy_gc 54522676
allhnfmod 438588
bezout_step 890931
col_dup 3771862
col_mul 3369460
count 10217998
count2 555293
do_zero 0
findi 129172286
findi_normalize 129172286
gbezout_step 882
gsmith 0
gsmithall 0
gsnf_no_divide 196
hnf 14
hnf_divscale 213307
hnf_i 62635
hnf_invimage 547578
hnf_invscale 275331
hnf_solve 461209
hnfadd 0
hnfadd_i 117255
hnfall 14
hnfallgen 21
hnfdivide 133
hnffinal 303824
hnflll 7
hnfmerge_get_1 816035
hnfmod 14
hnfmodid 438574
hnfperm 14
hnfspec 0
hnfspec_i 186569
hnfswap 11658459
is_RgX 2590
mathnf0 1428
mathnfspec 0
matsnf0 469
must_swap 6205041
negcmpii 602537
normalize_as_RgX 364
optimal_D 5220269
p_mat 0
reduce1 1016504
reduce2 64585235
remove_0cols 336476
reverse_rows 618680
smith 385
smithall 35
smithclean 952
snf_group 1081645
snf_pile 1124030
snf_pile1 48
snfrank 154
subzi 7927745
trivsmith 0
update 842365
zlm_echelon 4808738
zv_snf_rank 0

Generated by: LCOV version 2.0-1