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 - alglin3.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30702-bddb8d6928) Lines: 522 597 87.4 %
Date: 2026-02-23 02:23:56 Functions: 50 57 87.7 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
RgM_diagonal 0
parselect 0
rowsmallslice_i 0
veccatapply 0
veccatselapply 0
vecrangess 0
vecselect 0
RgX_apply 6
matmultodiagonal 6
ser_apply 6
arithprogset 10
gen_parapply_slice 10
parapply_slice_worker 10
rowslice_i 10
map_apply 18
vecsmallslice_i 20
fold0 24
genfold 24
extract_selector_ok 30
RgM_apply 36
map_apply_i 54
matmuldiagonal 60
extract_copy 61
select_0 73
genindexselect 77
genselect 78
select0 94
get_range 96
str_to_long 156
matslice0 162
vecselapply 363
zv_diagonal 576
parapply 960
vecslice0 1383
vecslice_parse_arg 1691
vecslice_i 2229
gen_parapply_slice_zv 5754
vecrange 9119
shallowmatextract 11327
row_transposecopy 13701
extract0 34146
gtrans 36625
apply0 44278
genapply 44278
shallowextract 45057
check_callgen1 45332
vecapply 113208
vecsum 127698
RgV_apply 157486
diagonal_shallow 297878
gen_parapply 318372
gen_parapply_percent 320862
gtomat 322471
RgM_diagonal_shallow 836426
diagonal 1101569
shallowtrans 5999275
row_transpose 22004840

Generated by: LCOV version 1.16