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-05 09:26:54 Functions: 89 92 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 359
compilestate_reset 452
countmatrixelts 462
compilenewptr 847
strtoclosure 1820
compilelvalue 1848
op_insert_loc 2975
compilemy 3566
countvar 3594
is_node_zero 4280
compilemat 9680
optimizemat 9680
ctxmvar 9738
closurefunc 10616
localvars_read_str 10992
getvarvec 12956
compilematcoeff 13609
optimizematcoeff 14610
compileseq 15220
optimizeseq 15220
matindex_type 15737
getclosure 20436
compilefuncinline 20711
checkdups 21009
compilecall 23375
optimizecall 23382
fetch_member_raw 25263
compilestore 46054
cattovec 48924
getlvalue 49678
compilestate_restore 56429
var_push 65891
getvar 67725
access_push 116741
addcopy 274708
getentry 366094
pari_close_compiler 371508
pari_init_compiler 373067
detag 448499
gp_closure 937125
compilestate_save 1431856
strntoGENexp 3822360
translate 3822364
data_push 4804505
snm_closure 9137258
genclosurectx 9138865
genclosure 9149695
genctx 9154166
frame_push 9164101
getfunction 10108039
getcodepos 10108087
optimizefunc 10763906
compilefunc 10768714
getmvar 11140877
gcopyunclone 13968584
compilevec 15460514
optimizevec 15461746
vec_optimize 15558676
compilecast 18614435
first_safe_arg 21591654
get_ret_type 21674751
getfunc 21935875
compilecast_loc 27755091
compilesmall 30552615
countlisttogen 52642929
listtogen 52642929
compilenode 52951041
optimizenode 62098825
op_push 115722482
is_func_named 118408132
parseproto 153727144
op_push_loc 159564403

Generated by: LCOV version 1.16