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) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31057-89c4d54ba6) Lines: 89.5 % 695 622
Test Date: 2026-07-25 17:02:42 Functions: 92.1 % 101 93
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function 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
real_0_digits 203
vars_to_RgXV 231
IS_ID 457
pari_is_default 980
pari_isbdigit 1064
gshift_right 1392
vars_sort_inplace 1484
pari_var_close 1887
is_ulong 1895
pari_var_init 1895
_given_value 3010
varentries_unset 3177
gpolvar 4655
cmp_by_var 5199
pari_fill_hashtable 5677
real_read_more 5690
varentries_set 9494
compile_str 10992
varstate_restore 13165
gsub1e 20965
ifpari_multi 30723
initep 36800
fetch_var 67748
exponent 75565
real_read 86710
strtor 86710
gmule 178685
pari_set_varstate 376653
var_restore 389818
fetch_user_var 454165
fetch_entry 454263
pari_var_create 485783
varstate_save 523432
is_long 532471
gadde 536517
readseq 804235
readseq_i 804235
dec_read_more 1042580
dec_strtoi_len 1042580
check_proto 2721180
isreturn 2721180
fill_hashtable_single 2745815
insertep 2782497
skipstring 3822335
dec_number_len 4140048
fetch_var_higher 8424706
delete_var 8492497
is_entry 9239193
ifpari 13122946
gsube 15455370
orpari 16723997
do_alias 21989979
fetch_entry_raw 22404687
gadd1e 25685202
skipexponent 31535645
skipconstante 31537401
skipdigits 31543719
int_read 31550879
strtoi 31550879
dec_read 31643177
findentry 31644860
number 31718742
ifpari_void 42401688
andpari 64287664
pari_lex 114191039
ishex 140374906
isbin 140374962

Generated by: LCOV version 2.0-1