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 30862-ea47bd413c) Lines: 1631 1811 90.1 %
Date: 2026-05-06 09:26:47 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 116741
addcopy 274708
call0 28
cattovec 48924
checkdups 21009
closure_deriv 0
closure_derivn 112
closurefunc 10616
closuretoinl 0
compilecall 23375
compilecast 18614435
compilecast_loc 27755176
compileexport 41
compilefunc 10768714
compilefuncinline 20711
compilelambda 359
compilelocal 28
compilelvalue 1848
compilemat 9680
compilematcoeff 13609
compilemy 3566
compilenewptr 847
compilenode 52951041
compileseq 15220
compilesmall 30552615
compilestate_reset 452
compilestate_restore 56429
compilestate_save 1431855
compilestore 46054
compileunexport 6
compileuninline 6
compilevec 15460514
countlisttogen 52642929
countmatrixelts 462
countvar 3594
ctxmvar 9738
data_push 4804505
debug_context 0
detag 448499
fetch_member_raw 25263
first_safe_arg 21591654
frame_push 9164177
gcopyunclone 13968644
genclosure 9149796
genclosurectx 9138962
genctx 9154221
get_ret_type 21674844
getclosure 20436
getcodepos 10108204
getentry 366094
getfunc 21935875
getfunction 10108103
getlvalue 49678
getmvar 11140877
getvar 67725
getvardyn 131
getvarvec 12956
gp_closure 937125
is_func_named 118408132
is_node_zero 4280
listtogen 52642929
localpush 70
localvars_find 7
localvars_read_str 10992
matchQ 8
matindex_type 15737
op_insert_loc 2975
op_push 115722482
op_push_loc 159564680
optimizecall 23382
optimizefunc 10763906
optimizemat 9680
optimizematcoeff 14610
optimizenode 62098825
optimizeseq 15220
optimizevec 15461746
pack_localvars 53
pari_close_compiler 371407
pari_init_compiler 373064
pari_translate_string 4
parseproto 153727933
push_frame 259
snm_closure 9137353
str_defproto 39
strntoGENexp 3822360
strtoclosure 1820
strtofunction 119
translate 3822364
var_push 65891
vec_optimize 15558676

Generated by: LCOV version 1.16