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 30556-bb9f5f8fc8) Lines: 1603 1779 90.1 %
Date: 2025-11-25 09:20:50 Functions: 96 106 90.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
FpM_echelon 3359516
FpM_hnfend 3359704
FpV_Fp_mul_part_ip 5388588
FpV_red_part_ipvec 37266994
Minus 2054108
RgC_elem 511
RgM_hnfall 42
RgM_reduce 84
RgXM_snf 49
ZC_elem 40415543
ZC_lincomb1z 21838742
ZC_lincomb1z_i 21846681
ZM_hnf 88241
ZM_hnf_knapsack 238
ZM_hnfall 28705
ZM_hnfall_i 750629
ZM_hnfcenter 25152
ZM_hnflll 230620
ZM_hnfmod 160257
ZM_hnfmodall 5079421
ZM_hnfmodall_i 5130432
ZM_hnfmodid 4479018
ZM_hnfmodprime 3359513
ZM_hnfperm 385
ZM_redpart 1546346
ZM_reduce 4446488
ZM_rowrankprofile 225091
ZM_snf 15869
ZM_snf_group 710556
ZM_snf_no_divide 1231074
ZM_snfall 63216
ZM_snfall_i 793182
ZM_snfclean 1026326
ZMrow_divexact_inplace 973732
ZV_allequal 322408
ZV_extgcd 110558
ZV_gcdext_i 110572
ZV_hnfgcdext 21
ZV_snf_group 315681
ZV_snf_rank 91
ZV_snf_rank_u 49
ZV_snf_trunc 0
ZV_snfall 315681
ZV_snfclean 225084
ZpM_echelon 527520
addmulzii 518278877
addzi 239529499
affii2_or_copy_gc 47826826
allhnfmod 438521
bezout_step 817132
col_dup 2607858
col_mul 3073922
count 8142587
count2 418965
do_zero 0
findi 105851458
findi_normalize 105843861
gbezout_step 882
gsmith 0
gsmithall 0
gsnf_no_divide 196
hnf 14
hnf_divscale 191798
hnf_i 61041
hnf_invimage 546752
hnf_invscale 274423
hnf_solve 460669
hnfadd 0
hnfadd_i 91264
hnfall 14
hnfallgen 21
hnfdivide 133
hnffinal 225091
hnflll 7
hnfmerge_get_1 812910
hnfmod 14
hnfmodid 438507
hnfperm 14
hnfspec 0
hnfspec_i 133827
hnfswap 8482800
is_RgX 2590
mathnf0 287
mathnfspec 0
matsnf0 469
must_swap 4618009
negcmpii 600933
normalize_as_RgX 364
optimal_D 5128476
p_mat 0
reduce1 967315
reduce2 52907169
remove_0cols 333383
reverse_rows 461217
smith 385
smithall 35
smithclean 672
snf_group 1026326
snf_pile 1067962
snf_pile1 48
snfrank 154
subzi 6449735
trivsmith 0
update 768498
zlm_echelon 4785329
zv_snf_rank 0

Generated by: LCOV version 1.16