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 - anal.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30764-6b81f1f3fa) Lines: 622 695 89.5 %
Date: 2026-03-25 09:26:52 Functions: 93 101 92.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
check_name 0
gp_read_str 0
gp_read_str_bitprec 0
gp_read_str_prec 0
install 0
name_var 0
pari_add_function 0
pari_var_next_temp 0
pari_var_next 4
fetch_var_value 7
gdivente 7
gdivrounde 7
gmode 7
gshiftle 7
gshiftre 7
kill0 14
killep 14
alias0 28
arity0 28
bin_read 28
varlower 34
eval_mnemonic 35
bin_number_len 37
_lower 42
addhelp 42
_higher 49
gdive 56
hex_read 74
binary_read 102
strtobin_len 102
varhigher 105
hex_number_len 108
var_register 118
varentries_reset 118
vars_to_RgXV 175
real_0_digits 203
IS_ID 457
pari_is_default 973
pari_isbdigit 1064
gpolvar 1183
gshift_right 1392
vars_sort_inplace 1428
pari_var_close 1880
is_ulong 1890
pari_var_init 1890
_given_value 3010
cmp_by_var 5150
pari_fill_hashtable 5660
real_read_more 5676
varentries_set 9400
compile_str 10992
varstate_restore 13144
varentries_unset 16321
gsub1e 20965
ifpari_multi 30723
initep 36377
exponent 75565
real_read 86696
strtor 86696
fetch_var 88286
gmule 178691
pari_set_varstate 372598
var_restore 385740
fetch_user_var 454134
fetch_entry 454232
pari_var_create 484786
varstate_save 518781
is_long 529170
gadde 536517
readseq 804235
readseq_i 804235
dec_read_more 1042076
dec_strtoi_len 1042076
check_proto 2691310
isreturn 2691310
fill_hashtable_single 2715880
insertep 2752139
skipstring 3822279
dec_number_len 4138093
fetch_var_higher 8422129
delete_var 8510466
is_entry 9263851
ifpari 13079147
gsube 15455370
orpari 16723451
do_alias 21975714
fetch_entry_raw 22390573
gadd1e 25685202
skipexponent 31531186
skipconstante 31532928
skipdigits 31539232
int_read 31546431
strtoi 31546431
dec_read 31638701
findentry 31655369
number 31714266
ifpari_void 42400388
andpari 64287524
pari_lex 114167442
ishex 140353203
isbin 140353259

Generated by: LCOV version 1.16