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-09 17:02:52 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 276493
call0 28
cattovec 49050
checkdups 21086
closure_deriv 0
closure_derivn 112
closurefunc 10616
closuretoinl 0
compilecall 23396
compilecast 18622138
compilecast_loc 27771683
compileexport 41
compilefunc 10773075
compilefuncinline 20788
compilelambda 359
compilelocal 28
compilelvalue 1848
compilemat 9687
compilematcoeff 13616
compilemy 3573
compilenewptr 847
compilenode 52960107
compileseq 15276
compilesmall 30554860
compilestate_reset 452
compilestate_restore 56443
compilestate_save 1432357
compilestore 46194
compileunexport 6
compileuninline 6
compilevec 15460612
countlisttogen 52652064
countmatrixelts 462
countvar 3601
ctxmvar 9745
data_push 4805081
debug_context 0
detag 450816
fetch_member_raw 25291
first_safe_arg 21600418
frame_push 9173014
gcopyunclone 13978095
genclosure 9158462
genclosurectx 9147721
genctx 9163047
get_ret_type 21692079
getclosure 20513
getcodepos 10117418
getentry 368145
getfunc 21946690
getfunction 10117362
getlvalue 49818
getmvar 11147205
getvar 67928
getvardyn 131
getvarvec 13019
gp_closure 937496
is_func_named 118456082
is_node_zero 4294
listtogen 52652064
localpush 70
localvars_find 7
localvars_read_str 10992
matchQ 8
matindex_type 15744
op_insert_loc 3430
op_push 115728544
op_push_loc 159618256
optimizecall 23403
optimizefunc 10768267
optimizemat 9687
optimizematcoeff 14617
optimizenode 62108373
optimizeseq 15276
optimizevec 15461851
pack_localvars 53
pari_close_compiler 378623
pari_init_compiler 378631
pari_translate_string 4
parseproto 153878991
push_frame 259
snm_closure 9146026
str_defproto 39
strntoGENexp 3822374
strtoclosure 1820
strtofunction 119
translate 3822378
var_push 65982
vec_optimize 15558893

Generated by: LCOV version 2.0-1