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 31053-95e3b72995) Lines: 90.0 % 1811 1630
Test Date: 2026-07-24 17:03:07 Functions: 96.7 % 92 89
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
L_compile_err 7
U_compile_err 7
access_push 116965
addcopy 276486
call0 28
cattovec 49050
checkdups 21086
closure_deriv 0
closure_derivn 112
closurefunc 10616
closuretoinl 0
compilecall 23396
compilecast 18622082
compilecast_loc 27770795
compileexport 41
compilefunc 10773019
compilefuncinline 20788
compilelambda 359
compilelocal 28
compilelvalue 1848
compilemat 9687
compilematcoeff 13616
compilemy 3573
compilenewptr 847
compilenode 52959974
compileseq 15276
compilesmall 30554783
compilestate_reset 452
compilestate_restore 56443
compilestate_save 1432327
compilestore 46194
compileunexport 6
compileuninline 6
compilevec 15460598
countlisttogen 52651924
countmatrixelts 462
countvar 3601
ctxmvar 9745
data_push 4805081
debug_context 0
detag 450809
fetch_member_raw 25291
first_safe_arg 21600306
frame_push 9172182
gcopyunclone 13977263
genclosure 9157630
genclosurectx 9146889
genctx 9162215
get_ret_type 21691156
getclosure 20513
getcodepos 10116565
getentry 368138
getfunc 21946571
getfunction 10116509
getlvalue 49818
getmvar 11147142
getvar 67928
getvardyn 131
getvarvec 13019
gp_closure 937475
is_func_named 118455466
is_node_zero 4294
listtogen 52651924
localpush 70
localvars_find 7
localvars_read_str 10992
matchQ 8
matindex_type 15744
op_insert_loc 3430
op_push 115728390
op_push_loc 159613442
optimizecall 23403
optimizefunc 10768211
optimizemat 9687
optimizematcoeff 14617
optimizenode 62108219
optimizeseq 15276
optimizevec 15461837
pack_localvars 53
pari_close_compiler 378540
pari_init_compiler 378548
pari_translate_string 4
parseproto 153864861
push_frame 259
snm_closure 9145194
str_defproto 39
strntoGENexp 3822374
strtoclosure 1820
strtofunction 119
translate 3822378
var_push 65982
vec_optimize 15558879

Generated by: LCOV version 2.0-1