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 30824-18397de1d0) Lines: 1599 1779 89.9 %
Date: 2026-04-18 09:26:04 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 427
compilestate_reset 452
compilenewptr 847
strtoclosure 1820
compilelvalue 1848
op_insert_loc 2975
compilemy 3545
countvar 3573
is_node_zero 4252
compilemat 9680
optimizemat 9680
ctxmvar 9710
closurefunc 10602
localvars_read_str 10992
compilematcoeff 13595
optimizematcoeff 14596
compileseq 15199
optimizeseq 15199
matindex_type 15723
getclosure 20394
compilefuncinline 20655
checkdups 20953
compilecall 23375
optimizecall 23382
fetch_member_raw 25263
compilestore 46026
cattovec 48854
getlvalue 49643
compilestate_restore 56422
var_push 65730
getvar 84322
access_push 116426
addcopy 274344
getentry 369399
pari_close_compiler 370515
pari_init_compiler 371941
detag 438694
gp_closure 937020
compilestate_save 1431615
strntoGENexp 3822346
translate 3822350
data_push 4804414
snm_closure 9128415
genclosurectx 9130016
genclosure 9140837
genctx 9145319
frame_push 9155131
getfunction 10098989
getcodepos 10099075
optimizefunc 10763290
compilefunc 10768112
getmvar 11139876
gcopyunclone 13959557
compilevec 15460353
optimizevec 15461585
vec_optimize 15558431
compilecast 18613231
first_safe_arg 21590394
get_ret_type 21664732
getfunc 21937976
compilecast_loc 27745028
compilesmall 30552139
countlisttogen 52641263
listtogen 52641263
compilenode 52949347
optimizenode 62096921
op_push 115720053
is_func_named 118401671
parseproto 153578016
op_push_loc 159506343

Generated by: LCOV version 1.16