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 30759-17b423fb9b) Lines: 1610 1786 90.1 %
Date: 2026-03-21 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 3364152
FpM_hnfend 3364377
FpV_Fp_mul_part_ip 5411882
FpV_red_part_ipvec 37727015
Minus 2996039
RgC_elem 511
RgM_hnfall 42
RgM_reduce 84
RgXM_snf 49
ZC_elem 41263538
ZC_lincomb1z 29937476
ZC_lincomb1z_i 29953543
ZM_hnf 89968
ZM_hnf_knapsack 238
ZM_hnfall 29357
ZM_hnfall_i 752631
ZM_hnfcenter 25166
ZM_hnfintersectmod 28
ZM_hnflll 309371
ZM_hnfmod 162596
ZM_hnfmodall 5140648
ZM_hnfmodall_i 5191749
ZM_hnfmodid 4537675
ZM_hnfmodprime 3364153
ZM_hnfperm 385
ZM_redpart 1689755
ZM_reduce 4474161
ZM_rowrankprofile 303855
ZM_snf 15925
ZM_snf_group 764399
ZM_snf_no_divide 1301778
ZM_snfall 64239
ZM_snfall_i 848107
ZM_snfclean 1081389
ZMrow_divexact_inplace 1070832
ZV_allequal 322714
ZV_extgcd 110572
ZV_gcdext_i 110586
ZV_hnfgcdext 21
ZV_snf_group 316941
ZV_snf_rank 91
ZV_snf_rank_u 49
ZV_snf_trunc 0
ZV_snfall 316940
ZV_snfclean 227088
ZpM_echelon 528221
addmulzii 583801605
addzi 277662046
affii2_or_copy_gc 54287663
allhnfmod 438514
bezout_step 890440
col_dup 3769177
col_mul 3367206
count 10216639
count2 554631
do_zero 0
findi 128719504
findi_normalize 128692237
gbezout_step 882
gsmith 0
gsmithall 0
gsnf_no_divide 196
hnf 14
hnf_divscale 197487
hnf_i 62117
hnf_invimage 547536
hnf_invscale 275322
hnf_solve 461169
hnfadd 0
hnfadd_i 117496
hnfall 14
hnfallgen 21
hnfdivide 133
hnffinal 303856
hnflll 7
hnfmerge_get_1 815982
hnfmod 14
hnfmodid 438501
hnfperm 14
hnfspec 0
hnfspec_i 186358
hnfswap 11613656
is_RgX 2590
mathnf0 287
mathnfspec 0
matsnf0 469
must_swap 6180247
negcmpii 602529
normalize_as_RgX 364
optimal_D 5189643
p_mat 0
reduce1 967385
reduce2 64329521
remove_0cols 336189
reverse_rows 618656
smith 385
smithall 35
smithclean 693
snf_group 1081395
snf_pile 1123498
snf_pile1 48
snfrank 154
subzi 7915383
trivsmith 0
update 841803
zlm_echelon 4802322
zv_snf_rank 0

Generated by: LCOV version 1.16