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.18.1 lcov report (development 31042-0fbe168e69) Lines: 90.2 % 1787 1611
Test Date: 2026-07-23 17:04:59 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 3366410
FpM_hnfend 3366410
FpV_Fp_mul_part_ip 5420872
FpV_red_part_ipvec 37830162
Minus 2997278
RgC_elem 511
RgM_hnfall 42
RgM_reduce 84
RgXM_snf 49
ZC_elem 41407713
ZC_lincomb1z 30080471
ZC_lincomb1z_i 30080471
ZM_hnf 90247
ZM_hnf_knapsack 238
ZM_hnfall 29170
ZM_hnfall_i 752457
ZM_hnfcenter 25387
ZM_hnfintersectmod 28
ZM_hnflll 309360
ZM_hnfmod 162656
ZM_hnfmodall 5145621
ZM_hnfmodall_i 5196851
ZM_hnfmodid 4542452
ZM_hnfmodprime 3366410
ZM_hnfperm 385
ZM_redpart 1690757
ZM_reduce 4454982
ZM_rowrankprofile 303844
ZM_snf 16184
ZM_snf_group 764697
ZM_snf_no_divide 1302063
ZM_snfall 64246
ZM_snfall_i 848676
ZM_snfclean 1081644
ZMrow_divexact_inplace 1071268
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 529499
addmulzii 592164488
addzi 283906255
affii2_or_copy_gc 54526249
allhnfmod 438580
bezout_step 891006
col_dup 3771826
col_mul 3369760
count 10218390
count2 555329
do_zero 0
findi 129171008
findi_normalize 129171008
gbezout_step 882
gsmith 0
gsmithall 0
gsnf_no_divide 196
hnf 14
hnf_divscale 197801
hnf_i 62582
hnf_invimage 547578
hnf_invscale 275331
hnf_solve 461209
hnfadd 0
hnfadd_i 117278
hnfall 14
hnfallgen 21
hnfdivide 133
hnffinal 303844
hnflll 7
hnfmerge_get_1 816035
hnfmod 14
hnfmodid 438566
hnfperm 14
hnfspec 0
hnfspec_i 186566
hnfswap 11659440
is_RgX 2590
mathnf0 1428
mathnfspec 0
matsnf0 469
must_swap 6205727
negcmpii 602537
normalize_as_RgX 364
optimal_D 5195213
p_mat 0
reduce1 1016504
reduce2 64584596
remove_0cols 336479
reverse_rows 618720
smith 385
smithall 35
smithclean 952
snf_group 1081644
snf_pile 1124029
snf_pile1 48
snfrank 154
subzi 7929808
trivsmith 0
update 842440
zlm_echelon 4808736
zv_snf_rank 0

Generated by: LCOV version 2.0-1