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 30622-caa25a75db) Lines: 1603 1779 90.1 %
Date: 2026-01-22 09:18:00 Functions: 96 106 90.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
FpM_echelon 3216731
FpM_hnfend 3216809
FpV_Fp_mul_part_ip 5199903
FpV_red_part_ipvec 36211175
Minus 2013843
RgC_elem 511
RgM_hnfall 42
RgM_reduce 84
RgXM_snf 49
ZC_elem 39614788
ZC_lincomb1z 21569327
ZC_lincomb1z_i 21575973
ZM_hnf 82778
ZM_hnf_knapsack 237
ZM_hnfall 27173
ZM_hnfall_i 718568
ZM_hnfcenter 22579
ZM_hnflll 222697
ZM_hnfmod 150799
ZM_hnfmodall 4913933
ZM_hnfmodall_i 4961681
ZM_hnfmodid 4339121
ZM_hnfmodprime 3216733
ZM_hnfperm 384
ZM_redpart 1419756
ZM_reduce 4254570
ZM_rowrankprofile 217177
ZM_snf 15899
ZM_snf_group 648279
ZM_snf_no_divide 1127452
ZM_snfall 58411
ZM_snfall_i 726135
ZM_snfclean 940356
ZMrow_divexact_inplace 896198
ZV_allequal 301890
ZV_extgcd 110572
ZV_gcdext_i 110586
ZV_hnfgcdext 21
ZV_snf_group 292077
ZV_snf_rank 91
ZV_snf_rank_u 49
ZV_snf_trunc 0
ZV_snfall 292077
ZV_snfclean 199245
ZpM_echelon 474384
addmulzii 516116143
addzi 238250966
affii2_or_copy_gc 47664507
allhnfmod 422093
bezout_step 760808
col_dup 2546810
col_mul 2848934
count 8083005
count2 409314
do_zero 0
findi 104394245
findi_normalize 104384560
gbezout_step 882
gsmith 0
gsmithall 0
gsnf_no_divide 196
hnf 14
hnf_divscale 190884
hnf_i 57094
hnf_invimage 506759
hnf_invscale 247554
hnf_solve 426340
hnfadd 0
hnfadd_i 88381
hnfall 14
hnfallgen 21
hnfdivide 133
hnffinal 217177
hnflll 7
hnfmerge_get_1 755337
hnfmod 14
hnfmodid 422079
hnfperm 14
hnfspec 0
hnfspec_i 128795
hnfswap 8318382
is_RgX 2590
mathnf0 287
mathnfspec 0
matsnf0 468
must_swap 4480811
negcmpii 560331
normalize_as_RgX 364
optimal_D 4960127
p_mat 0
reduce1 967385
reduce2 52176539
remove_0cols 303627
reverse_rows 445375
smith 384
smithall 35
smithclean 674
snf_group 940357
snf_pile 980998
snf_pile1 48
snfrank 154
subzi 6329540
trivsmith 0
update 712238
zlm_echelon 4501412
zv_snf_rank 0

Generated by: LCOV version 1.16