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 30106-3f17b77578) Lines: 1608 1779 90.4 %
Date: 2025-03-31 09:19:50 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 21
compilelocal 28
compileexport 41
pack_localvars 53
localpush 70
str_defproto 91
closure_derivn 112
strtofunction 119
getvardyn 131
push_frame 259
compilelambda 339
countmatrixelts 427
compilestate_reset 445
compilenewptr 840
strtoclosure 1820
compilelvalue 1834
op_insert_loc 2975
compilemy 3392
countvar 3420
is_node_zero 4036
ctxmvar 9571
compilemat 9653
optimizemat 9653
closurefunc 10468
localvars_read_str 10992
compilematcoeff 13421
optimizematcoeff 14415
compileseq 14841
optimizeseq 14841
matindex_type 15535
getclosure 20119
compilefuncinline 20374
checkdups 20550
compilecall 23200
optimizecall 23207
fetch_member_raw 25221
compilestore 45274
cattovec 48128
getlvalue 48793
compilestate_restore 56290
var_push 65132
getvar 82757
access_push 114746
addcopy 268588
pari_close_compiler 335943
pari_init_compiler 337241
getentry 361944
detag 429697
strntoGENexp 880304
translate 880308
gp_closure 934608
compilestate_save 1429176
data_push 1757899
compilevec 4463164
optimizevec 4464372
vec_optimize 4560349
optimizefunc 4621800
compilefunc 4626585
getmvar 4991394
compilecast 6686234
snm_closure 8012064
genclosurectx 8013698
genclosure 8024342
genctx 8028813
frame_push 8038378
getfunction 8979881
getcodepos 8979925
first_safe_arg 9306794
getfunc 9647289
gcopyunclone 9796311
compilesmall 11100293
get_ret_type 13589188
compilecast_loc 14701749
countlisttogen 18362382
listtogen 18362382
compilenode 18628830
optimizenode 22450195
op_push 38512218
is_func_named 50846088
op_push_loc 76023814
parseproto 121718808

Generated by: LCOV version 1.16