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 29950-285c5b69ed) Lines: 1608 1779 90.4 %
Date: 2025-02-05 09:09:51 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 113248
addcopy 264479
call0 21
cattovec 47526
checkdups 20270
closure_deriv 0
closure_derivn 105
closurefunc 10335
closuretoinl 0
compilecall 22871
compilecast 6674457
compilecast_loc 14685448
compileexport 41
compilefunc 4621279
compilefuncinline 20269
compilelambda 339
compilelocal 28
compilelvalue 1820
compilemat 9618
compilematcoeff 13162
compilemy 3315
compilenewptr 833
compilenode 18613619
compileseq 14701
compilesmall 11096992
compilestate_reset 438
compilestate_restore 56115
compilestate_save 1427133
compilestore 44378
compileunexport 6
compileuninline 6
compilevec 4462471
countlisttogen 18349075
countmatrixelts 406
countvar 3343
ctxmvar 9452
data_push 1757406
debug_context 0
detag 422872
fetch_member_raw 25137
first_safe_arg 9295510
frame_push 8033576
gcopyunclone 9790968
genclosure 8019731
genclosurectx 8009221
genctx 8024193
get_ret_type 13574462
getclosure 20014
getcodepos 8973456
getentry 356323
getfunc 9630643
getfunction 8973367
getlvalue 47855
getmvar 4980383
getvar 81378
getvardyn 131
gp_closure 932851
is_func_named 50788289
is_node_zero 4001
listtogen 18349075
localpush 70
localvars_find 7
localvars_read_str 10992
matchQ 8
matindex_type 15262
op_insert_loc 2975
op_push 38495544
op_push_loc 75984589
optimizecall 22878
optimizefunc 4616606
optimizemat 9618
optimizematcoeff 14149
optimizenode 22432394
optimizeseq 14701
optimizevec 4463658
pack_localvars 53
pari_close_compiler 334727
pari_init_compiler 335889
pari_translate_string 4
parseproto 121637039
push_frame 259
snm_closure 8007576
str_defproto 91
strntoGENexp 880171
strtoclosure 1820
strtofunction 119
translate 880175
var_push 64726
vec_optimize 4558774

Generated by: LCOV version 1.16