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 30842-de08e65e1b) Lines: 1610 1786 90.1 %
Date: 2026-04-29 09:26:11 Functions: 97 107 90.7 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
FpM_echelon 3364151
FpM_hnfend 3364411
FpV_Fp_mul_part_ip 5411947
FpV_red_part_ipvec 37716650
Minus 2994054
RgC_elem 511
RgM_hnfall 42
RgM_reduce 84
RgXM_snf 49
ZC_elem 41252217
ZC_lincomb1z 29892138
ZC_lincomb1z_i 29919390
ZM_hnf 90295
ZM_hnf_knapsack 238
ZM_hnfall 29346
ZM_hnfall_i 752621
ZM_hnfcenter 25172
ZM_hnfintersectmod 28
ZM_hnflll 309054
ZM_hnfmod 162609
ZM_hnfmodall 5140110
ZM_hnfmodall_i 5191227
ZM_hnfmodid 4537145
ZM_hnfmodprime 3364163
ZM_hnfperm 385
ZM_redpart 1689673
ZM_reduce 4473319
ZM_rowrankprofile 303540
ZM_snf 15925
ZM_snf_group 764342
ZM_snf_no_divide 1301753
ZM_snfall 64239
ZM_snfall_i 848057
ZM_snfclean 1081390
ZMrow_divexact_inplace 1070723
ZV_allequal 322710
ZV_extgcd 110572
ZV_gcdext_i 111776
ZV_hnfgcdext 1211
ZV_snf_group 316941
ZV_snf_rank 91
ZV_snf_rank_u 49
ZV_snf_trunc 0
ZV_snfall 316941
ZV_snfclean 227087
ZpM_echelon 528226
addmulzii 582949513
addzi 276824830
affii2_or_copy_gc 54230827
allhnfmod 438541
bezout_step 890541
col_dup 3769041
col_mul 3367524
count 10215698
count2 554473
do_zero 0
findi 128617999
findi_normalize 128592512
gbezout_step 882
gsmith 0
gsmithall 0
gsnf_no_divide 196
hnf 14
hnf_divscale 197511
hnf_i 62454
hnf_invimage 547533
hnf_invscale 275325
hnf_solve 461150
hnfadd 0
hnfadd_i 117187
hnfall 14
hnfallgen 21
hnfdivide 133
hnffinal 303540
hnflll 7
hnfmerge_get_1 815984
hnfmod 14
hnfmodid 438526
hnfperm 14
hnfspec 0
hnfspec_i 186354
hnfswap 11613982
is_RgX 2590
mathnf0 1477
mathnfspec 0
matsnf0 469
must_swap 6186701
negcmpii 602522
normalize_as_RgX 364
optimal_D 5189294
p_mat 0
reduce1 1013907
reduce2 64263681
remove_0cols 336510
reverse_rows 618055
smith 385
smithall 35
smithclean 693
snf_group 1081396
snf_pile 1123483
snf_pile1 48
snfrank 154
subzi 7908257
trivsmith 0
update 841899
zlm_echelon 4802279
zv_snf_rank 0

Generated by: LCOV version 1.16