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: 1602 1778 90.1 %
Date: 2025-06-01 09:19:36 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 28775
hnf_i 61705
ZM_snfall 63959
ZM_hnf 89002
hnfadd_i 91287
ZV_extgcd 110572
ZV_gcdext_i 110586
hnfspec_i 134229
ZM_hnfmod 162503
hnf_divscale 196661
ZV_snfclean 214527
ZM_rowrankprofile 225514
hnffinal 225516
ZM_hnflll 231023
hnf_invscale 237701
ZV_allequal 282417
ZV_snf_group 304175
ZV_snfall 304175
remove_0cols 322633
hnf_solve 370758
hnfmodid 409298
allhnfmod 409312
count2 420194
hnf_invimage 422119
reverse_rows 462042
negcmpii 520877
ZpM_echelon 528043
ZM_snf_group 644517
update 674985
bezout_step 703110
ZM_snfall_i 722888
ZM_hnfall_i 726467
hnfmerge_get_1 743867
ZMrow_divexact_inplace 864035
ZM_snfclean 948796
snf_group 948802
reduce1 967385
snf_pile 985867
ZM_snf_no_divide 1077603
ZM_redpart 1388710
Minus 2049577
col_dup 2608307
col_mul 2699876
ZM_hnfmodprime 3143125
FpM_echelon 3143134
FpM_hnfend 3143330
ZM_reduce 4142818
ZM_hnfmodid 4265086
must_swap 4613481
zlm_echelon 4670545
ZM_hnfmodall 4838504
optimal_D 4887154
ZM_hnfmodall_i 4889120
FpV_Fp_mul_part_ip 5308930
subzi 6444547
count 8100482
hnfswap 8472360
ZC_lincomb1z 21808522
ZC_lincomb1z_i 21818776
FpV_red_part_ipvec 35896818
ZC_elem 39705609
affii2_or_copy_gc 47765575
reduce2 52875284
findi_normalize 105780440
findi 105787645
addzi 239265395
addmulzii 517629423

Generated by: LCOV version 1.16