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 30849-48ff4d246c) Lines: 1610 1786 90.1 %
Date: 2026-05-01 09:26:53 Functions: 97 107 90.7 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
FpM_echelon 3364248
FpM_hnfend 3364468
FpV_Fp_mul_part_ip 5412032
FpV_red_part_ipvec 37719952
Minus 2994962
RgC_elem 511
RgM_hnfall 42
RgM_reduce 84
RgXM_snf 49
ZC_elem 41254414
ZC_lincomb1z 29906246
ZC_lincomb1z_i 29929061
ZM_hnf 90340
ZM_hnf_knapsack 238
ZM_hnfall 29385
ZM_hnfall_i 752656
ZM_hnfcenter 25172
ZM_hnfintersectmod 28
ZM_hnflll 309178
ZM_hnfmod 162610
ZM_hnfmodall 5140386
ZM_hnfmodall_i 5191502
ZM_hnfmodid 4537446
ZM_hnfmodprime 3364108
ZM_hnfperm 385
ZM_redpart 1689731
ZM_reduce 4474049
ZM_rowrankprofile 303661
ZM_snf 15925
ZM_snf_group 764331
ZM_snf_no_divide 1301781
ZM_snfall 64239
ZM_snfall_i 848046
ZM_snfclean 1081383
ZMrow_divexact_inplace 1070729
ZV_allequal 322715
ZV_extgcd 110572
ZV_gcdext_i 111776
ZV_hnfgcdext 1211
ZV_snf_group 316938
ZV_snf_rank 91
ZV_snf_rank_u 49
ZV_snf_trunc 0
ZV_snfall 316938
ZV_snfclean 227091
ZpM_echelon 528241
addmulzii 583118615
addzi 277082127
affii2_or_copy_gc 54233591
allhnfmod 438538
bezout_step 890562
col_dup 3768829
col_mul 3367383
count 10216059
count2 554636
do_zero 0
findi 128655914
findi_normalize 128635881
gbezout_step 882
gsmith 0
gsmithall 0
gsnf_no_divide 196
hnf 14
hnf_divscale 197524
hnf_i 62460
hnf_invimage 547532
hnf_invscale 275323
hnf_solve 461148
hnfadd 0
hnfadd_i 117315
hnfall 14
hnfallgen 21
hnfdivide 133
hnffinal 303662
hnflll 7
hnfmerge_get_1 815981
hnfmod 14
hnfmodid 438524
hnfperm 14
hnfspec 0
hnfspec_i 186343
hnfswap 11616461
is_RgX 2590
mathnf0 1477
mathnfspec 0
matsnf0 469
must_swap 6189457
negcmpii 602527
normalize_as_RgX 364
optimal_D 5189534
p_mat 0
reduce1 1013907
reduce2 64284112
remove_0cols 336555
reverse_rows 618297
smith 385
smithall 35
smithclean 693
snf_group 1081387
snf_pile 1123478
snf_pile1 48
snfrank 154
subzi 7910869
trivsmith 0
update 841876
zlm_echelon 4802481
zv_snf_rank 0

Generated by: LCOV version 1.16