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 30772-246cd0a587) Lines: 1599 1779 89.9 %
Date: 2026-03-29 09:27:34 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 115684
addcopy 273336
call0 28
cattovec 48672
checkdups 20799
closure_deriv 0
closure_derivn 112
closurefunc 10581
closuretoinl 0
compilecall 23333
compilecast 18610067
compilecast_loc 27785056
compileexport 41
compilefunc 10766411
compilefuncinline 20550
compilelambda 352
compilelocal 28
compilelvalue 1848
compilemat 9680
compilematcoeff 13602
compilemy 3461
compilenewptr 847
compilenode 52945350
compileseq 15136
compilesmall 30551201
compilestate_reset 452
compilestate_restore 56422
compilestate_save 1431442
compilestore 45942
compileunexport 6
compileuninline 6
compilevec 15460220
countlisttogen 52637413
countmatrixelts 441
countvar 3489
ctxmvar 9668
data_push 4804232
debug_context 0
detag 436944
fetch_member_raw 25263
first_safe_arg 21586908
frame_push 9198122
gcopyunclone 14002376
genclosure 9183911
genclosurectx 9173135
genctx 9188392
get_ret_type 21704638
getclosure 20289
getcodepos 10141891
getentry 368013
getfunc 21933160
getfunction 10141931
getlvalue 49566
getmvar 11137013
getvar 83965
getvardyn 131
gp_closure 936908
is_func_named 118383429
is_node_zero 4161
listtogen 52637413
localpush 70
localvars_find 7
localvars_read_str 10992
matchQ 8
matindex_type 15730
op_insert_loc 2975
op_push 115716861
op_push_loc 159717241
optimizecall 23340
optimizefunc 10761617
optimizemat 9680
optimizematcoeff 14603
optimizenode 62092581
optimizeseq 15136
optimizevec 15461466
pack_localvars 53
pari_close_compiler 372711
pari_init_compiler 374556
pari_translate_string 4
parseproto 154216194
push_frame 259
snm_closure 9171470
str_defproto 39
strntoGENexp 3822318
strtoclosure 1820
strtofunction 119
translate 3822322
var_push 65492
vec_optimize 15558088

Generated by: LCOV version 1.16