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 30733-eb2d773d38) Lines: 1599 1779 89.9 %
Date: 2026-03-03 09:24:12 Functions: 88 91 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 115277
addcopy 270959
call0 28
cattovec 48560
checkdups 20682
closure_deriv 0
closure_derivn 112
closurefunc 10574
closuretoinl 0
compilecall 23305
compilecast 18601079
compilecast_loc 27770850
compileexport 41
compilefunc 10761774
compilefuncinline 20488
compilelambda 339
compilelocal 28
compilelvalue 1834
compilemat 9674
compilematcoeff 13554
compilemy 3420
compilenewptr 840
compilenode 52934482
compileseq 15095
compilesmall 30548310
compilestate_reset 452
compilestate_restore 56422
compilestate_save 1431216
compilestore 45872
compileunexport 6
compileuninline 6
compilevec 15459478
countlisttogen 52626411
countmatrixelts 427
countvar 3448
ctxmvar 9620
data_push 4804114
debug_context 0
detag 433932
fetch_member_raw 25263
first_safe_arg 21577578
frame_push 9192758
gcopyunclone 13996829
genclosure 9178658
genclosurectx 9167914
genctx 9183071
get_ret_type 21690242
getclosure 20240
getcodepos 10136458
getentry 365326
getfunc 21921157
getfunction 10136440
getlvalue 49489
getmvar 11129866
getvar 83662
getvardyn 131
gp_closure 936741
is_func_named 118332698
is_node_zero 4120
listtogen 52626411
localpush 70
localvars_find 7
localvars_read_str 10992
matchQ 8
matindex_type 15668
op_insert_loc 2975
op_push 115707385
op_push_loc 159675349
optimizecall 23312
optimizefunc 10756987
optimizemat 9674
optimizematcoeff 14548
optimizenode 62080795
optimizeseq 15095
optimizevec 15460710
pack_localvars 53
pari_close_compiler 372069
pari_init_compiler 373649
pari_translate_string 4
parseproto 154105322
push_frame 259
snm_closure 9166267
str_defproto 39
strntoGENexp 3822297
strtoclosure 1820
strtofunction 119
translate 3822301
var_push 65320
vec_optimize 15557188

Generated by: LCOV version 1.16