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 30764-6b81f1f3fa) Lines: 1610 1786 90.1 %
Date: 2026-03-26 09:27:02 Functions: 97 107 90.7 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
FpM_echelon 3364291
FpM_hnfend 3364388
FpV_Fp_mul_part_ip 5412034
FpV_red_part_ipvec 37728526
Minus 2994666
RgC_elem 511
RgM_hnfall 42
RgM_reduce 84
RgXM_snf 49
ZC_elem 41264046
ZC_lincomb1z 29930728
ZC_lincomb1z_i 29947949
ZM_hnf 89967
ZM_hnf_knapsack 238
ZM_hnfall 29342
ZM_hnfall_i 752612
ZM_hnfcenter 25165
ZM_hnfintersectmod 28
ZM_hnflll 309199
ZM_hnfmod 162599
ZM_hnfmodall 5140497
ZM_hnfmodall_i 5191610
ZM_hnfmodid 4537563
ZM_hnfmodprime 3364249
ZM_hnfperm 385
ZM_redpart 1689797
ZM_reduce 4475063
ZM_rowrankprofile 303683
ZM_snf 15925
ZM_snf_group 764371
ZM_snf_no_divide 1301806
ZM_snfall 64237
ZM_snfall_i 848077
ZM_snfclean 1081375
ZMrow_divexact_inplace 1070765
ZV_allequal 322716
ZV_extgcd 110572
ZV_gcdext_i 110586
ZV_hnfgcdext 21
ZV_snf_group 316942
ZV_snf_rank 91
ZV_snf_rank_u 49
ZV_snf_trunc 0
ZV_snfall 316942
ZV_snfclean 227094
ZpM_echelon 528235
addmulzii 583666409
addzi 277854415
affii2_or_copy_gc 54278584
allhnfmod 438506
bezout_step 890583
col_dup 3769124
col_mul 3367649
count 10216784
count2 554820
do_zero 0
findi 128698914
findi_normalize 128670326
gbezout_step 882
gsmith 0
gsmithall 0
gsnf_no_divide 196
hnf 14
hnf_divscale 197486
hnf_i 62130
hnf_invimage 547524
hnf_invscale 275323
hnf_solve 461147
hnfadd 0
hnfadd_i 117327
hnfall 14
hnfallgen 21
hnfdivide 133
hnffinal 303685
hnflll 7
hnfmerge_get_1 815995
hnfmod 14
hnfmodid 438492
hnfperm 14
hnfspec 0
hnfspec_i 186345
hnfswap 11610368
is_RgX 2590
mathnf0 287
mathnfspec 0
matsnf0 469
must_swap 6178322
negcmpii 602531
normalize_as_RgX 364
optimal_D 5189734
p_mat 0
reduce1 967385
reduce2 64317862
remove_0cols 336191
reverse_rows 618379
smith 385
smithall 35
smithclean 693
snf_group 1081400
snf_pile 1123490
snf_pile1 48
snfrank 154
subzi 7908540
trivsmith 0
update 841926
zlm_echelon 4802521
zv_snf_rank 0

Generated by: LCOV version 1.16