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 31041-bd73e9fcdd) Lines: 90.2 % 1787 1611
Test Date: 2026-07-22 22:45:42 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 25386
ZM_hnfall 29132
hnf_i 62573
ZM_snfall 64246
ZM_hnf 90200
ZV_extgcd 110579
ZV_gcdext_i 111734
hnfadd_i 117162
ZM_hnfmod 162654
hnfspec_i 186566
hnf_divscale 197799
ZV_snfclean 227089
hnf_invscale 275317
ZM_rowrankprofile 303730
hnffinal 303732
ZM_hnflll 309248
ZV_snf_group 316938
ZV_snfall 316938
ZV_allequal 322725
remove_0cols 336405
hnfmodid 438563
allhnfmod 438577
hnf_solve 461166
ZpM_echelon 529494
hnf_invimage 547546
count2 555163
negcmpii 602523
reverse_rows 618453
ZM_hnfall_i 752395
ZM_snf_group 764579
hnfmerge_get_1 815992
update 842186
ZM_snfall_i 848551
bezout_step 890824
reduce1 1016504
ZMrow_divexact_inplace 1071024
ZM_snfclean 1081621
snf_group 1081626
snf_pile 1123941
ZM_snf_no_divide 1301936
ZM_redpart 1690291
Minus 2997937
ZM_hnfmodprime 3365826
FpM_echelon 3365829
FpM_hnfend 3366057
col_mul 3368651
col_dup 3771363
ZM_reduce 4454360
ZM_hnfmodid 4541115
zlm_echelon 4808387
ZM_hnfmodall 5144165
optimal_D 5193532
ZM_hnfmodall_i 5195437
FpV_Fp_mul_part_ip 5420041
must_swap 6194166
subzi 7920362
count 10217204
hnfswap 11623926
ZC_lincomb1z 29921355
ZC_lincomb1z_i 29946093
FpV_red_part_ipvec 37791185
ZC_elem 41376744
affii2_or_copy_gc 54249264
reduce2 64303783
findi_normalize 128681547
findi 128703611
addzi 276985276
addmulzii 583027428

Generated by: LCOV version 2.0-1