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-09-24 17:04:29 Functions: 90.7 % 107 97
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function 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
gbezout_step 882
smithclean 952
ZV_hnfgcdext 1162
mathnf0 1428
is_RgX 2590
ZM_snf 16184
ZM_hnfcenter 25385
ZM_hnfall 29134
hnf_i 62612
ZM_snfall 64246
ZM_hnf 90241
ZV_extgcd 110579
ZV_gcdext_i 111734
hnfadd_i 117143
ZM_hnfmod 159548
hnfspec_i 186571
hnf_divscale 213301
ZV_snfclean 227101
hnf_invscale 275331
ZM_rowrankprofile 303714
hnffinal 303714
ZM_hnflll 309230
ZV_snf_group 316947
ZV_snfall 316947
ZV_allequal 322729
remove_0cols 336473
hnfmodid 438564
allhnfmod 438578
hnf_solve 461209
ZpM_echelon 529489
hnf_invimage 547578
count2 555267
negcmpii 602537
reverse_rows 618460
ZM_hnfall_i 752469
ZM_snf_group 764698
hnfmerge_get_1 816035
update 842463
ZM_snfall_i 848677
bezout_step 891029
reduce1 1016504
ZMrow_divexact_inplace 1071270
ZM_snfclean 1081645
snf_group 1081645
snf_pile 1124030
ZM_snf_no_divide 1302045
ZM_redpart 1690763
Minus 2997342
FpM_echelon 3366415
FpM_hnfend 3366415
ZM_hnfmodprime 3366415
col_mul 3369852
col_dup 3771883
ZM_reduce 4463353
ZM_hnfmodid 4570660
zlm_echelon 4808665
ZM_hnfmodall 5170719
optimal_D 5220311
ZM_hnfmodall_i 5221949
FpV_Fp_mul_part_ip 5411947
must_swap 6203484
subzi 7929271
count 10220448
hnfswap 11657668
ZC_lincomb1z 30075094
ZC_lincomb1z_i 30075094
FpV_red_part_ipvec 37982063
ZC_elem 41517528
affii2_or_copy_gc 54521569
reduce2 64587148
findi 129176113
findi_normalize 129176113
addzi 283875868
addmulzii 592144885

Generated by: LCOV version 2.0-1