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

Generated by: LCOV version 1.16