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 30759-17b423fb9b) Lines: 1599 1779 89.9 %
Date: 2026-03-20 09:26:27 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
str_defproto 39
compileexport 41
pack_localvars 53
localpush 70
closure_derivn 112
strtofunction 119
getvardyn 131
push_frame 259
compilelambda 352
countmatrixelts 441
compilestate_reset 452
compilenewptr 847
strtoclosure 1820
compilelvalue 1848
op_insert_loc 2975
compilemy 3461
countvar 3489
is_node_zero 4161
ctxmvar 9668
compilemat 9680
optimizemat 9680
closurefunc 10581
localvars_read_str 10992
compilematcoeff 13602
optimizematcoeff 14603
compileseq 15136
optimizeseq 15136
matindex_type 15730
getclosure 20289
compilefuncinline 20550
checkdups 20799
compilecall 23333
optimizecall 23340
fetch_member_raw 25263
compilestore 45921
cattovec 48672
getlvalue 49545
compilestate_restore 56422
var_push 65492
getvar 83944
access_push 115684
addcopy 273203
getentry 367859
pari_close_compiler 373143
pari_init_compiler 374622
detag 436769
gp_closure 936838
compilestate_save 1431367
strntoGENexp 3822318
translate 3822322
data_push 4804232
snm_closure 9171672
genclosurectx 9173303
genclosure 9184066
genctx 9188511
frame_push 9198258
getfunction 10141993
getcodepos 10142042
optimizefunc 10761386
compilefunc 10766180
getmvar 11136628
gcopyunclone 14002517
compilevec 15460185
optimizevec 15461431
vec_optimize 15558053
compilecast 18609626
first_safe_arg 21586446
get_ret_type 21704329
getfunc 21932544
compilecast_loc 27784751
compilesmall 30551075
countlisttogen 52636881
listtogen 52636881
compilenode 52944797
optimizenode 62091993
op_push 115716350
is_func_named 118380888
parseproto 154217010
op_push_loc 159717379

Generated by: LCOV version 1.16