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 30851-7844d7b3a5) Lines: 1629 1809 90.0 %
Date: 2026-05-03 09:26:29 Functions: 89 92 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 116671
addcopy 274652
call0 28
cattovec 48924
checkdups 20995
closure_deriv 0
closure_derivn 112
closurefunc 10602
closuretoinl 0
compilecall 23375
compilecast 18614176
compilecast_loc 27752777
compileexport 41
compilefunc 10768546
compilefuncinline 20697
compilelambda 359
compilelocal 28
compilelvalue 1848
compilemat 9680
compilematcoeff 13595
compilemy 3552
compilenewptr 847
compilenode 52950670
compileseq 15213
compilesmall 30552524
compilestate_reset 452
compilestate_restore 56422
compilestate_save 1431745
compilestore 46047
compileunexport 6
compileuninline 6
compilevec 15460500
countlisttogen 52642551
countmatrixelts 462
countvar 3580
ctxmvar 9724
data_push 4804470
debug_context 0
detag 446655
fetch_member_raw 25263
first_safe_arg 21591318
frame_push 9162006
gcopyunclone 13966520
genclosure 9147699
genclosurectx 9136815
genctx 9152195
get_ret_type 21672462
getclosure 20422
getcodepos 10105998
getentry 364341
getfunc 21933821
getfunction 10105927
getlvalue 49671
getmvar 11140646
getvar 66042
getvardyn 131
getvarvec 12956
gp_closure 937118
is_func_named 118406480
is_node_zero 4259
listtogen 52642551
localpush 70
localvars_find 7
localvars_read_str 10992
matchQ 8
matindex_type 15723
op_insert_loc 2975
op_push 115722097
op_push_loc 159555054
optimizecall 23382
optimizefunc 10763752
optimizemat 9680
optimizematcoeff 14596
optimizenode 62098363
optimizeseq 15213
optimizevec 15461732
pack_localvars 53
pari_close_compiler 371475
pari_init_compiler 372876
pari_translate_string 4
parseproto 153699748
push_frame 259
snm_closure 9135262
str_defproto 39
strntoGENexp 3822353
strtoclosure 1820
strtofunction 119
translate 3822357
var_push 65870
vec_optimize 15558648

Generated by: LCOV version 1.16