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 30316-0578a48613) Lines: 1604 1778 90.2 %
Date: 2025-06-04 09:19:51 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 238
mathnf0 287
normalize_as_RgX 364
ZM_hnfperm 385
smith 385
matsnf0 469
RgC_elem 511
smithclean 693
gbezout_step 882
is_RgX 2590
ZM_snf 10864
ZM_hnfcenter 25173
ZM_hnfall 28768
hnf_i 61702
ZM_snfall 63957
ZM_hnf 88993
hnfadd_i 91356
ZV_extgcd 110572
ZV_gcdext_i 110586
hnfspec_i 134225
ZM_hnfmod 162502
hnf_divscale 196655
ZV_snfclean 214528
hnffinal 225580
ZM_rowrankprofile 225581
ZM_hnflll 231089
hnf_invscale 237699
ZV_allequal 282415
ZV_snf_group 304177
ZV_snfall 304177
remove_0cols 322626
hnf_solve 370748
hnfmodid 409304
allhnfmod 409318
count2 420424
hnf_invimage 422124
reverse_rows 462166
negcmpii 520881
ZpM_echelon 528030
ZM_snf_group 644537
update 675174
bezout_step 703278
ZM_snfall_i 722904
ZM_hnfall_i 726454
hnfmerge_get_1 743869
ZMrow_divexact_inplace 864011
ZM_snfclean 948785
snf_group 948787
reduce1 967385
snf_pile 985897
ZM_snf_no_divide 1077735
ZM_redpart 1389018
Minus 2050354
col_dup 2608266
col_mul 2700650
FpM_echelon 3142987
ZM_hnfmodprime 3143116
FpM_hnfend 3143294
ZM_reduce 4144668
ZM_hnfmodid 4264927
must_swap 4614974
zlm_echelon 4670544
ZM_hnfmodall 4838345
optimal_D 4887048
ZM_hnfmodall_i 4888933
FpV_Fp_mul_part_ip 5308956
subzi 6443722
count 8100662
hnfswap 8474010
ZC_lincomb1z 21810321
ZC_lincomb1z_i 21821024
FpV_red_part_ipvec 35895636
ZC_elem 39708453
affii2_or_copy_gc 47764687
reduce2 52879564
findi_normalize 105790452
findi 105797505
addzi 239219530
addmulzii 517617410

Generated by: LCOV version 1.16