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 29877-9124a6ce27) Lines: 1608 1779 90.4 %
Date: 2025-01-18 09:08:44 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 113178
addcopy 264052
call0 21
cattovec 47442
checkdups 20249
closure_deriv 0
closure_derivn 105
closurefunc 10307
closuretoinl 0
compilecall 22850
compilecast 6671611
compilecast_loc 14679580
compileexport 41
compilefunc 4673142
compilefuncinline 20255
compilelambda 339
compilelocal 28
compilelvalue 1820
compilemat 9611
compilematcoeff 13155
compilemy 3301
compilenewptr 833
compilenode 18606718
compileseq 14687
compilesmall 11092951
compilestate_reset 438
compilestate_restore 56122
compilestate_save 1426914
compilestore 44343
compileunexport 6
compileuninline 6
compilevec 4462415
countlisttogen 18452598
countmatrixelts 406
countvar 3329
ctxmvar 9445
data_push 1757772
debug_context 0
detag 422263
fetch_member_raw 25137
first_safe_arg 9399194
frame_push 8030499
gcopyunclone 9788258
genclosure 8016665
genclosurectx 8006156
genctx 8021124
get_ret_type 13620645
getclosure 20000
getcodepos 8970166
getentry 355805
getfunc 9733865
getfunction 8970121
getlvalue 47820
getmvar 5031742
getvar 81315
getvardyn 131
gp_closure 932648
is_func_named 51358992
is_node_zero 3987
listtogen 18452598
localpush 70
localvars_find 7
localvars_read_str 10992
matchQ 8
matindex_type 15255
op_insert_loc 2975
op_push 38490812
op_push_loc 75961195
optimizecall 22857
optimizefunc 4668497
optimizemat 9611
optimizematcoeff 14142
optimizenode 22479931
optimizeseq 14687
optimizevec 4463602
pack_localvars 53
pari_close_compiler 333476
pari_init_compiler 334441
pari_translate_string 4
parseproto 121680550
push_frame 259
snm_closure 8004528
str_defproto 91
strntoGENexp 880150
strtoclosure 1820
strtofunction 119
translate 880154
var_push 64698
vec_optimize 4558627

Generated by: LCOV version 1.16