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 30744-52374ab6cf) Lines: 552 597 92.5 %
Date: 2026-03-17 09:26:37 Functions: 51 57 89.5 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
RgM_diagonal 0
rowsmallslice_i 0
veccatapply 0
veccatselapply 0
vecrangess 0
vecselect 0
RgX_apply 7
matmultodiagonal 7
ser_apply 7
rowslice_i 14
map_apply 21
fold0 28
genfold 28
vecsmallslice_i 28
parselect 30
extract_selector_ok 35
RgM_apply 42
parapply_slice_worker 44
map_apply_i 63
matmuldiagonal 70
extract_copy 101
genselect 104
genindexselect 110
get_range 112
select0 131
str_to_long 182
matslice0 210
vecselapply 469
zv_diagonal 672
select_0 1023
vecslice0 1666
parapply 1744
vecslice_parse_arg 2065
vecslice_i 2702
gen_parapply_slice_zv 6713
gen_parapply_slice 7696
vecrange 10863
shallowmatextract 13216
row_transposecopy 20606
extract0 40768
gtrans 44682
apply0 53267
genapply 53267
shallowextract 54500
check_callgen1 55172
arithprogset 91607
vecapply 132318
vecsum 151838
RgV_apply 185585
diagonal_shallow 349548
gen_parapply 371770
gen_parapply_percent 374717
gtomat 377746
RgM_diagonal_shallow 1058307
diagonal 1347971
shallowtrans 7452150
row_transpose 27215291

Generated by: LCOV version 1.16