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 30748-2ce22a5f1f) Lines: 1599 1779 89.9 %
Date: 2026-03-18 09:25:54 Functions: 88 91 96.7 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
L_compile_err 7
U_compile_err 7
access_push 115684
addcopy 273203
call0 28
cattovec 48672
checkdups 20799
closure_deriv 0
closure_derivn 112
closurefunc 10581
closuretoinl 0
compilecall 23333
compilecast 18609626
compilecast_loc 27784580
compileexport 41
compilefunc 10766180
compilefuncinline 20550
compilelambda 352
compilelocal 28
compilelvalue 1848
compilemat 9680
compilematcoeff 13602
compilemy 3461
compilenewptr 847
compilenode 52944797
compileseq 15136
compilesmall 30551075
compilestate_reset 452
compilestate_restore 56422
compilestate_save 1431372
compilestore 45921
compileunexport 6
compileuninline 6
compilevec 15460185
countlisttogen 52636881
countmatrixelts 441
countvar 3489
ctxmvar 9668
data_push 4804232
debug_context 0
detag 436769
fetch_member_raw 25263
first_safe_arg 21586446
frame_push 9198141
gcopyunclone 14002399
genclosure 9183982
genclosurectx 9173202
genctx 9188378
get_ret_type 21704239
getclosure 20289
getcodepos 10141926
getentry 367859
getfunc 21932544
getfunction 10141855
getlvalue 49545
getmvar 11136628
getvar 83944
getvardyn 131
gp_closure 936838
is_func_named 118380888
is_node_zero 4161
listtogen 52636881
localpush 70
localvars_find 7
localvars_read_str 10992
matchQ 8
matindex_type 15730
op_insert_loc 2975
op_push 115716350
op_push_loc 159716508
optimizecall 23340
optimizefunc 10761386
optimizemat 9680
optimizematcoeff 14603
optimizenode 62091993
optimizeseq 15136
optimizevec 15461431
pack_localvars 53
pari_close_compiler 373613
pari_init_compiler 374682
pari_translate_string 4
parseproto 154215114
push_frame 259
snm_closure 9171578
str_defproto 39
strntoGENexp 3822318
strtoclosure 1820
strtofunction 119
translate 3822322
var_push 65492
vec_optimize 15558053

Generated by: LCOV version 1.16