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) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31042-0fbe168e69) Lines: 90.0 % 1811 1630
Test Date: 2026-07-23 17:04:59 Functions: 96.7 % 92 89
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
closure_deriv 0
closuretoinl 0
debug_context 0
pari_translate_string 4
compileunexport 6
compileuninline 6
L_compile_err 7
U_compile_err 7
localvars_find 7
matchQ 8
call0 28
compilelocal 28
str_defproto 39
compileexport 41
pack_localvars 53
localpush 70
closure_derivn 112
strtofunction 119
getvardyn 131
push_frame 259
compilelambda 359
compilestate_reset 452
countmatrixelts 462
compilenewptr 847
strtoclosure 1820
compilelvalue 1848
op_insert_loc 3052
compilemy 3573
countvar 3601
is_node_zero 4294
compilemat 9687
optimizemat 9687
ctxmvar 9745
closurefunc 10616
localvars_read_str 10992
getvarvec 13012
compilematcoeff 13616
optimizematcoeff 14617
compileseq 15276
optimizeseq 15276
matindex_type 15744
getclosure 20506
compilefuncinline 20781
checkdups 21079
compilecall 23396
optimizecall 23403
fetch_member_raw 25291
compilestore 46194
cattovec 49050
getlvalue 49818
compilestate_restore 56443
var_push 65975
getvar 67921
access_push 116958
addcopy 275982
getentry 367620
pari_close_compiler 378540
pari_init_compiler 378548
detag 450284
gp_closure 937461
compilestate_save 1432294
strntoGENexp 3822374
translate 3822378
data_push 4804628
snm_closure 9145276
genclosurectx 9146971
genclosure 9157712
genctx 9162297
frame_push 9172257
getfunction 10116570
getcodepos 10116626
optimizefunc 10766650
compilefunc 10771458
getmvar 11145077
gcopyunclone 13976885
compilevec 15460591
optimizevec 15461830
vec_optimize 15558872
compilecast 18619067
first_safe_arg 21597184
get_ret_type 21688116
getfunc 21942931
compilecast_loc 27767862
compilesmall 30554193
countlisttogen 52648788
listtogen 52648788
compilenode 52956866
optimizenode 62105104
op_push 115726787
is_func_named 118438288
parseproto 153856036
op_push_loc 159610246

Generated by: LCOV version 2.0-1