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.1 lcov report (development 28676-df828f1c94) Lines: 1594 1751 91.0 %
Date: 2023-08-26 07:54:43 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 104655
addcopy 246260
call0 21
cattovec 44368
checkdups 19019
closure_deriv 0
closure_derivn 105
closurefunc 9852
compilecall 22234
compilecast 6212587
compilecast_loc 12028963
compileexport 41
compilefunc 4430679
compilefuncinline 19064
compilelambda 300
compilelocal 28
compilelvalue 1764
compilemat 9401
compilematcoeff 12196
compilemy 3031
compilenewptr 805
compilenode 17314793
compileseq 13794
compilesmall 10392404
compilestate_reset 385
compilestate_restore 46966
compilestate_save 1407738
compilestore 40010
compileunexport 6
compileuninline 6
compilevec 4049255
countlisttogen 17136108
countmatrixelts 357
countvar 3059
ctxmvar 9154
data_push 1639262
debug_context 0
detag 391052
fetch_member_raw 23807
first_safe_arg 8912728
frame_push 5837640
gcopyunclone 7476910
genclosure 5824547
genclosurectx 5814545
genctx 5828800
get_ret_type 11150641
getclosure 18848
getcodepos 6769546
getentry 330079
getfunc 9222387
getfunction 6769514
getlvalue 43175
getmvar 4765631
getvar 73836
getvardyn 131
gp_closure 925073
is_func_named 48694445
is_node_zero 3833
listtogen 17136108
localpush 70
localvars_find 7
localvars_read_str 10789
matchQ 8
matindex_type 14240
op_insert_loc 2954
op_push 35579752
op_push_loc 63879002
optimizecall 22241
optimizefunc 4425964
optimizemat 9401
optimizematcoeff 13155
optimizenode 20953547
optimizeseq 13794
optimizevec 4050316
pack_localvars 53
pari_close_compiler 314182
pari_init_compiler 315951
pari_translate_string 4
parseproto 93686887
push_frame 259
snm_closure 5812881
str_defproto 91
strntoGENexp 764065
strtoclosure 1820
strtofunction 119
translate 764069
var_push 61791
vec_optimize 4142169

Generated by: LCOV version 1.14