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-24 09:26:44 Functions: 97 107 90.7 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
FpM_echelon 3364206
FpM_hnfend 3364380
FpV_Fp_mul_part_ip 5412056
FpV_red_part_ipvec 37727863
Minus 2995996
RgC_elem 511
RgM_hnfall 42
RgM_reduce 84
RgXM_snf 49
ZC_elem 41254503
ZC_lincomb1z 29943876
ZC_lincomb1z_i 29957726
ZM_hnf 89906
ZM_hnf_knapsack 238
ZM_hnfall 29302
ZM_hnfall_i 752579
ZM_hnfcenter 25165
ZM_hnfintersectmod 28
ZM_hnflll 309287
ZM_hnfmod 162602
ZM_hnfmodall 5140373
ZM_hnfmodall_i 5191472
ZM_hnfmodid 4537445
ZM_hnfmodprime 3364176
ZM_hnfperm 385
ZM_redpart 1689663
ZM_reduce 4466813
ZM_rowrankprofile 303773
ZM_snf 15925
ZM_snf_group 764402
ZM_snf_no_divide 1301735
ZM_snfall 64239
ZM_snfall_i 848108
ZM_snfclean 1081381
ZMrow_divexact_inplace 1070815
ZV_allequal 322718
ZV_extgcd 110572
ZV_gcdext_i 110586
ZV_hnfgcdext 21
ZV_snf_group 316943
ZV_snf_rank 91
ZV_snf_rank_u 49
ZV_snf_trunc 0
ZV_snfall 316943
ZV_snfclean 227072
ZpM_echelon 528226
addmulzii 583786350
addzi 277963321
affii2_or_copy_gc 54293873
allhnfmod 438504
bezout_step 890486
col_dup 3769168
col_mul 3367232
count 10216912
count2 554579
do_zero 0
findi 128732163
findi_normalize 128714185
gbezout_step 882
gsmith 0
gsmithall 0
gsnf_no_divide 196
hnf 14
hnf_divscale 197485
hnf_i 62109
hnf_invimage 547538
hnf_invscale 275327
hnf_solve 461164
hnfadd 0
hnfadd_i 117420
hnfall 14
hnfallgen 21
hnfdivide 133
hnffinal 303774
hnflll 7
hnfmerge_get_1 815995
hnfmod 14
hnfmodid 438490
hnfperm 14
hnfspec 0
hnfspec_i 186349
hnfswap 11615743
is_RgX 2590
mathnf0 287
mathnfspec 0
matsnf0 469
must_swap 6180273
negcmpii 602522
normalize_as_RgX 364
optimal_D 5189649
p_mat 0
reduce1 967385
reduce2 64335107
remove_0cols 336127
reverse_rows 618553
smith 385
smithall 35
smithclean 693
snf_group 1081384
snf_pile 1123504
snf_pile1 48
snfrank 154
subzi 7912728
trivsmith 0
update 841827
zlm_echelon 4802499
zv_snf_rank 0

Generated by: LCOV version 1.16