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 30818-1d7bcd2a3c) Lines: 1599 1779 89.9 %
Date: 2026-04-16 09:26:05 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 116426
addcopy 274344
call0 28
cattovec 48854
checkdups 20953
closure_deriv 0
closure_derivn 112
closurefunc 10602
closuretoinl 0
compilecall 23375
compilecast 18613231
compilecast_loc 27744863
compileexport 41
compilefunc 10768112
compilefuncinline 20655
compilelambda 352
compilelocal 28
compilelvalue 1848
compilemat 9680
compilematcoeff 13595
compilemy 3545
compilenewptr 847
compilenode 52949347
compileseq 15199
compilesmall 30552139
compilestate_reset 452
compilestate_restore 56422
compilestate_save 1431625
compilestore 46026
compileunexport 6
compileuninline 6
compilevec 15460353
countlisttogen 52641263
countmatrixelts 427
countvar 3573
ctxmvar 9710
data_push 4804414
debug_context 0
detag 438694
fetch_member_raw 25263
first_safe_arg 21590394
frame_push 9154931
gcopyunclone 13959344
genclosure 9140641
genclosurectx 9129801
genctx 9145099
get_ret_type 21664523
getclosure 20394
getcodepos 10098865
getentry 369399
getfunc 21937976
getfunction 10098812
getlvalue 49643
getmvar 11139876
getvar 84322
getvardyn 131
gp_closure 937020
is_func_named 118401671
is_node_zero 4252
listtogen 52641263
localpush 70
localvars_find 7
localvars_read_str 10992
matchQ 8
matindex_type 15723
op_insert_loc 2975
op_push 115720053
op_push_loc 159505466
optimizecall 23382
optimizefunc 10763290
optimizemat 9680
optimizematcoeff 14596
optimizenode 62096921
optimizeseq 15199
optimizevec 15461585
pack_localvars 53
pari_close_compiler 370664
pari_init_compiler 371940
pari_translate_string 4
parseproto 153575152
push_frame 259
snm_closure 9128124
str_defproto 39
strntoGENexp 3822346
strtoclosure 1820
strtofunction 119
translate 3822350
var_push 65730
vec_optimize 15558431

Generated by: LCOV version 1.16