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.19.0 lcov report (development 31092-e6893b0017) Lines: 90.0 % 1811 1630
Test Date: 2026-08-12 17:02:34 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 3430
compilemy 3573
countvar 3601
is_node_zero 4294
compilemat 9687
optimizemat 9687
ctxmvar 9745
closurefunc 10616
localvars_read_str 10992
getvarvec 13019
compilematcoeff 13616
optimizematcoeff 14617
compileseq 15276
optimizeseq 15276
matindex_type 15744
getclosure 20513
compilefuncinline 20788
checkdups 21086
compilecall 23396
optimizecall 23403
fetch_member_raw 25291
compilestore 46194
cattovec 49050
getlvalue 49818
compilestate_restore 56443
var_push 65982
getvar 67928
access_push 116965
addcopy 276493
getentry 368145
pari_close_compiler 378623
pari_init_compiler 378631
detag 450816
gp_closure 937496
compilestate_save 1432364
strntoGENexp 3822374
translate 3822378
data_push 4805081
snm_closure 9145998
genclosurectx 9147693
genclosure 9158434
genctx 9163019
frame_push 9172986
getfunction 10117334
getcodepos 10117390
optimizefunc 10768267
compilefunc 10773075
getmvar 11147205
gcopyunclone 13978067
compilevec 15460612
optimizevec 15461851
vec_optimize 15558893
compilecast 18622138
first_safe_arg 21600418
get_ret_type 21692051
getfunc 21946690
compilecast_loc 27771655
compilesmall 30554860
countlisttogen 52652064
listtogen 52652064
compilenode 52960107
optimizenode 62108373
op_push 115728544
is_func_named 118456082
parseproto 153878826
op_push_loc 159618201

Generated by: LCOV version 2.0-1