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 29420-55f63b8cfe) Lines: 1607 1767 90.9 %
Date: 2024-07-03 09:03:24 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 108152
addcopy 252565
call0 21
cattovec 45594
checkdups 19745
closure_deriv 0
closure_derivn 105
closurefunc 10139
compilecall 22542
compilecast 6639058
compilecast_loc 14578019
compileexport 41
compilefunc 4657182
compilefuncinline 19772
compilelambda 339
compilelocal 28
compilelvalue 1792
compilemat 9457
compilematcoeff 12588
compilemy 3217
compilenewptr 819
compilenode 18563717
compileseq 14253
compilesmall 11083007
compilestate_reset 431
compilestate_restore 48590
compilestate_save 1415047
compilestore 41452
compileunexport 6
compileuninline 6
compilevec 4460812
countlisttogen 18414840
countmatrixelts 399
countvar 3245
ctxmvar 9319
data_push 1756684
debug_context 0
detag 403083
fetch_member_raw 24801
first_safe_arg 9366602
frame_push 7961027
gcopyunclone 9717744
genclosure 7947541
genclosurectx 7937217
genctx 7951842
get_ret_type 13521097
getclosure 19517
getcodepos 8896355
getentry 339726
getfunc 9685537
getfunction 8896253
getlvalue 44768
getmvar 5000620
getvar 76891
getvardyn 131
gp_closure 928392
is_func_named 51184377
is_node_zero 3966
listtogen 18414840
localpush 70
localvars_find 7
localvars_read_str 10992
matchQ 8
matindex_type 14660
op_insert_loc 2926
op_push 38446635
op_push_loc 75479439
optimizecall 22549
optimizefunc 4652663
optimizemat 9457
optimizematcoeff 13561
optimizenode 22429895
optimizeseq 14253
optimizevec 4461964
pack_localvars 53
pari_close_compiler 323187
pari_init_compiler 324319
pari_translate_string 4
parseproto 120325419
push_frame 259
snm_closure 7935588
str_defproto 91
strntoGENexp 879688
strtoclosure 1820
strtofunction 119
translate 879692
var_push 63564
vec_optimize 4555239

Generated by: LCOV version 1.16