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 30107-5d3c5ac62a) Lines: 1608 1779 90.4 %
Date: 2025-04-01 09:20:36 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 114746
addcopy 268588
call0 21
cattovec 48128
checkdups 20550
closure_deriv 0
closure_derivn 112
closurefunc 10468
closuretoinl 0
compilecall 23200
compilecast 6686234
compilecast_loc 14701580
compileexport 41
compilefunc 4626585
compilefuncinline 20374
compilelambda 339
compilelocal 28
compilelvalue 1834
compilemat 9653
compilematcoeff 13421
compilemy 3392
compilenewptr 840
compilenode 18628830
compileseq 14841
compilesmall 11100293
compilestate_reset 445
compilestate_restore 56290
compilestate_save 1429171
compilestore 45274
compileunexport 6
compileuninline 6
compilevec 4463164
countlisttogen 18362382
countmatrixelts 427
countvar 3420
ctxmvar 9571
data_push 1757899
debug_context 0
detag 429697
fetch_member_raw 25221
first_safe_arg 9306794
frame_push 8038209
gcopyunclone 9796118
genclosure 8024173
genclosurectx 8013531
genctx 8028622
get_ret_type 13589016
getclosure 20119
getcodepos 8979770
getentry 361944
getfunc 9647289
getfunction 8979712
getlvalue 48793
getmvar 4991394
getvar 82757
getvardyn 131
gp_closure 934608
is_func_named 50846088
is_node_zero 4036
listtogen 18362382
localpush 70
localvars_find 7
localvars_read_str 10992
matchQ 8
matindex_type 15535
op_insert_loc 2975
op_push 38512218
op_push_loc 76023081
optimizecall 23207
optimizefunc 4621800
optimizemat 9653
optimizematcoeff 14415
optimizenode 22450195
optimizeseq 14841
optimizevec 4464372
pack_localvars 53
pari_close_compiler 336180
pari_init_compiler 337210
pari_translate_string 4
parseproto 121716663
push_frame 259
snm_closure 8011892
str_defproto 91
strntoGENexp 880304
strtoclosure 1820
strtofunction 119
translate 880308
var_push 65132
vec_optimize 4560349

Generated by: LCOV version 1.16