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) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31092-e6893b0017) Lines: 87.6 % 646 566
Test Date: 2026-08-03 17:05:01 Functions: 85.2 % 61 52
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
RgM_apply 42
RgM_diagonal 0
RgM_diagonal_shallow 1059000
RgV_apply 185865
RgX_apply 7
apply0 53519
arithprogset 92704
check_callgen1 55424
diagonal 1348699
diagonal_shallow 349629
eqcatselapply 0
eqselapply 70
extract0 39914
extract_copy 101
extract_selector_ok 35
fold0 28
gen_parapply 372069
gen_parapply_percent 382068
gen_parapply_slice 7750
gen_parapply_slice_zv 6825
gen_parpairwiseop 0
gen_parpairwiseop_percent 0
genapply 53519
genfold 28
genindexselect 110
genselect 104
get_range 112
gtomat 377817
gtrans 43744
map_apply 21
map_apply_i 63
matmuldiagonal 70
matmultodiagonal 7
matslice0 210
parapply 1744
parapply_slice_worker 44
parselect 30
row_transpose 27280210
row_transposecopy 18730
rowslice_i 14
rowsmallslice_i 0
select0 131
select_0 85
ser_apply 7
shallowextract 52687
shallowmatextract 13216
shallowtrans 7471019
str_to_long 182
vecapply 132346
veccatapply 0
veccatselapply 0
vecrange 10877
vecrangess 0
vecselapply 469
vecselect 0
vecslice0 1666
vecslice_i 2702
vecslice_parse_arg 2065
vecsmallslice_i 28
vecsum 153203
zv_diagonal 672

Generated by: LCOV version 2.0-1