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 30773-2078653b96) Lines: 1599 1779 89.9 %
Date: 2026-04-04 09:27:12 Functions: 88 91 96.7 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by 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 352
countmatrixelts 441
compilestate_reset 452
compilenewptr 847
strtoclosure 1820
compilelvalue 1848
op_insert_loc 2975
compilemy 3461
countvar 3489
is_node_zero 4161
ctxmvar 9668
compilemat 9680
optimizemat 9680
closurefunc 10581
localvars_read_str 10992
compilematcoeff 13602
optimizematcoeff 14603
compileseq 15136
optimizeseq 15136
matindex_type 15730
getclosure 20289
compilefuncinline 20550
checkdups 20799
compilecall 23333
optimizecall 23340
fetch_member_raw 25263
compilestore 45942
cattovec 48672
getlvalue 49566
compilestate_restore 56422
var_push 65492
getvar 83965
access_push 115684
addcopy 273336
getentry 368013
pari_close_compiler 373236
pari_init_compiler 374694
detag 436944
gp_closure 936908
compilestate_save 1431452
strntoGENexp 3822318
translate 3822322
data_push 4804232
snm_closure 9171582
genclosurectx 9173200
genclosure 9183972
genctx 9188441
frame_push 9198178
getfunction 10141994
getcodepos 10142005
optimizefunc 10761617
compilefunc 10766411
getmvar 11137013
gcopyunclone 14002426
compilevec 15460220
optimizevec 15461466
vec_optimize 15558088
compilecast 18610067
first_safe_arg 21586908
get_ret_type 21704694
getfunc 21933160
compilecast_loc 27785138
compilesmall 30551201
countlisttogen 52637413
listtogen 52637413
compilenode 52945350
optimizenode 62092581
op_push 115716861
is_func_named 118383429
parseproto 154217121
op_push_loc 159717560

Generated by: LCOV version 1.16