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 - language - compile.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30674-be81ecfdd4) Lines: 1608 1779 90.4 %
Date: 2026-02-10 09:23:17 Functions: 88 91 96.7 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
closure_deriv 0
closuretoinl 0
debug_context 0
pari_translate_string 4
compileunexport 6
compileuninline 6
L_compile_err 7
U_compile_err 7
localvars_find 7
matchQ 8
call0 28
compilelocal 28
compileexport 41
pack_localvars 53
localpush 70
str_defproto 95
closure_derivn 112
strtofunction 119
getvardyn 131
push_frame 259
compilelambda 339
countmatrixelts 427
compilestate_reset 452
compilenewptr 840
strtoclosure 1820
compilelvalue 1834
op_insert_loc 2975
compilemy 3420
countvar 3448
is_node_zero 4113
ctxmvar 9606
compilemat 9667
optimizemat 9667
closurefunc 10531
localvars_read_str 10992
compilematcoeff 13554
optimizematcoeff 14548
compileseq 15093
optimizeseq 15093
matindex_type 15668
getclosure 20231
compilefuncinline 20486
checkdups 20669
compilecall 23305
optimizecall 23312
fetch_member_raw 25263
compilestore 45876
cattovec 48296
getlvalue 49493
compilestate_restore 56395
var_push 65300
getvar 83639
access_push 115236
addcopy 270709
getentry 365010
pari_close_compiler 371215
pari_init_compiler 373294
detag 433617
gp_closure 936029
compilestate_save 1430485
strntoGENexp 3822191
translate 3822195
data_push 4803999
snm_closure 9164763
genclosurectx 9166390
genclosure 9177111
genctx 9181535
frame_push 9191207
getfunction 10134151
getcodepos 10134187
optimizefunc 10755403
compilefunc 10760223
getmvar 11128070
gcopyunclone 13995222
compilevec 15459324
optimizevec 15460560
vec_optimize 15556852
compilecast 18598965
first_safe_arg 21574322
get_ret_type 21685628
getfunc 21917750
compilecast_loc 27767187
compilesmall 30547360
countlisttogen 52622867
listtogen 52622867
compilenode 52931407
optimizenode 62077503
op_push 115704526
is_func_named 118315602
parseproto 154073292
op_push_loc 159663052

Generated by: LCOV version 1.16