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.16.2 lcov report (development 29115-f22e516b23) Lines: 1605 1765 90.9 %
Date: 2024-04-20 08:07:50 Functions: 88 90 97.8 %
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 107221
addcopy 249800
call0 21
cattovec 45216
checkdups 19493
closure_deriv 0
closure_derivn 105
closurefunc 10055
compilecall 22409
compilecast 6500197
compilecast_loc 14575219
compileexport 41
compilefunc 4586356
compilefuncinline 19541
compilelambda 339
compilelocal 28
compilelvalue 1792
compilemat 9408
compilematcoeff 12497
compilemy 3175
compilenewptr 819
compilenode 18169573
compileseq 14057
compilesmall 10863501
compilestate_reset 417
compilestate_restore 48451
compilestate_save 1413075
compilestore 40906
compileunexport 6
compileuninline 6
compilevec 4333790
countlisttogen 18017863
countmatrixelts 399
countvar 3203
ctxmvar 9256
data_push 1720102
debug_context 0
detag 398400
fetch_member_raw 24773
first_safe_arg 9224474
frame_push 8096786
gcopyunclone 9816925
genclosure 8083466
genclosurectx 8073226
genctx 8087736
get_ret_type 13578766
getclosure 19286
getcodepos 9030712
getentry 335827
getfunc 9539783
getfunction 9030653
getlvalue 44166
getmvar 4926161
getvar 75841
getvardyn 131
gp_closure 927034
is_func_named 50405690
is_node_zero 3910
listtogen 18017863
localpush 70
localvars_find 7
localvars_read_str 10992
matchQ 8
matindex_type 14569
op_insert_loc 2926
op_push 37552133
op_push_loc 75246198
optimizecall 22416
optimizefunc 4581816
optimizemat 9408
optimizematcoeff 13470
optimizenode 21970919
optimizeseq 14057
optimizevec 4334935
pack_localvars 53
pari_close_compiler 315870
pari_init_compiler 318330
pari_translate_string 4
parseproto 122172917
push_frame 259
snm_closure 8070107
str_defproto 91
strntoGENexp 843764
strtoclosure 3304
strtofunction 119
translate 843768
var_push 63221
vec_optimize 4427559

Generated by: LCOV version 1.14