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 30067-63f6f11d79) Lines: 1608 1779 90.4 %
Date: 2025-03-10 09:19:41 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 114739
addcopy 268490
call0 21
cattovec 48100
checkdups 20543
closure_deriv 0
closure_derivn 112
closurefunc 10461
closuretoinl 0
compilecall 23158
compilecast 6686016
compilecast_loc 14704536
compileexport 41
compilefunc 4626529
compilefuncinline 20388
compilelambda 339
compilelocal 28
compilelvalue 1834
compilemat 9653
compilematcoeff 13414
compilemy 3392
compilenewptr 840
compilenode 18628480
compileseq 14841
compilesmall 11100231
compilestate_reset 445
compilestate_restore 56283
compilestate_save 1429078
compilestore 45239
compileunexport 6
compileuninline 6
compilevec 4463108
countlisttogen 18362074
countmatrixelts 427
countvar 3420
ctxmvar 9564
data_push 1757891
debug_context 0
detag 429515
fetch_member_raw 25221
first_safe_arg 9306598
frame_push 8041364
gcopyunclone 9799310
genclosure 8027368
genclosurectx 8016697
genctx 8031842
get_ret_type 13592119
getclosure 20133
getcodepos 8982856
getentry 361797
getfunc 9646960
getfunction 8982815
getlvalue 48758
getmvar 4991121
getvar 82715
getvardyn 131
gp_closure 934531
is_func_named 50845479
is_node_zero 4036
listtogen 18362074
localpush 70
localvars_find 7
localvars_read_str 10992
matchQ 8
matindex_type 15528
op_insert_loc 2975
op_push 38511644
op_push_loc 76035773
optimizecall 23165
optimizefunc 4621751
optimizemat 9653
optimizematcoeff 14408
optimizenode 22449740
optimizeseq 14841
optimizevec 4464316
pack_localvars 53
pari_close_compiler 336898
pari_init_compiler 337836
pari_translate_string 4
parseproto 121756227
push_frame 259
snm_closure 8015095
str_defproto 91
strntoGENexp 880304
strtoclosure 1820
strtofunction 119
translate 880308
var_push 65125
vec_optimize 4560237

Generated by: LCOV version 1.16