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 30587-f85873d515) Lines: 1603 1779 90.1 %
Date: 2025-12-27 09:21:13 Functions: 96 106 90.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
FpM_echelon 3364121
FpM_hnfend 3364339
FpV_Fp_mul_part_ip 5411512
FpV_red_part_ipvec 37686784
Minus 2057009
RgC_elem 511
RgM_hnfall 42
RgM_reduce 84
RgXM_snf 49
ZC_elem 41195170
ZC_lincomb1z 21896952
ZC_lincomb1z_i 21905186
ZM_hnf 89449
ZM_hnf_knapsack 238
ZM_hnfall 29215
ZM_hnfall_i 752492
ZM_hnfcenter 25167
ZM_hnflll 232602
ZM_hnfmod 162545
ZM_hnfmodall 5134081
ZM_hnfmodall_i 5185349
ZM_hnfmodid 4531647
ZM_hnfmodprime 3364097
ZM_hnfperm 385
ZM_redpart 1551684
ZM_reduce 4477027
ZM_rowrankprofile 227071
ZM_snf 15925
ZM_snf_group 712638
ZM_snf_no_divide 1235263
ZM_snfall 64183
ZM_snfall_i 796286
ZM_snfclean 1029517
ZMrow_divexact_inplace 976414
ZV_allequal 322710
ZV_extgcd 110572
ZV_gcdext_i 110586
ZV_hnfgcdext 21
ZV_snf_group 316795
ZV_snf_rank 91
ZV_snf_rank_u 49
ZV_snf_trunc 0
ZV_snfall 316795
ZV_snfclean 227084
ZpM_echelon 528154
addmulzii 520541778
addzi 240383615
affii2_or_copy_gc 48044528
allhnfmod 438211
bezout_step 820360
col_dup 2614804
col_mul 3086856
count 8158588
count2 421153
do_zero 0
findi 106472263
findi_normalize 106463458
gbezout_step 882
gsmith 0
gsmithall 0
gsnf_no_divide 196
hnf 14
hnf_divscale 197500
hnf_i 61739
hnf_invimage 547541
hnf_invscale 275326
hnf_solve 461159
hnfadd 0
hnfadd_i 92510
hnfall 14
hnfallgen 21
hnfdivide 133
hnffinal 227072
hnflll 7
hnfmerge_get_1 815974
hnfmod 14
hnfmodid 438198
hnfperm 14
hnfspec 0
hnfspec_i 134562
hnfswap 8507018
is_RgX 2590
mathnf0 287
mathnfspec 0
matsnf0 469
must_swap 4628060
negcmpii 602156
normalize_as_RgX 364
optimal_D 5183382
p_mat 0
reduce1 967385
reduce2 53218357
remove_0cols 335677
reverse_rows 465179
smith 385
smithall 35
smithclean 693
snf_group 1029519
snf_pile 1071672
snf_pile1 48
snfrank 154
subzi 6480766
trivsmith 0
update 771725
zlm_echelon 4801577
zv_snf_rank 0

Generated by: LCOV version 1.16