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 30831-19b50a36d0) Lines: 622 695 89.5 %
Date: 2026-04-20 09:27:00 Functions: 93 101 92.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
IS_ID 457
_given_value 3010
_higher 49
_lower 42
addhelp 42
alias0 28
andpari 64287608
arity0 28
bin_number_len 37
bin_read 28
binary_read 102
check_name 0
check_proto 2712660
cmp_by_var 5150
compile_str 10992
dec_number_len 4138125
dec_read 31639891
dec_read_more 1042090
dec_strtoi_len 1042090
delete_var 8510515
do_alias 21981195
eval_mnemonic 35
exponent 75565
fetch_entry 454246
fetch_entry_raw 22396019
fetch_user_var 454148
fetch_var 88286
fetch_var_higher 8422166
fetch_var_value 7
fill_hashtable_single 2737321
findentry 31617819
gadd1e 25685202
gadde 536517
gdive 56
gdivente 7
gdivrounde 7
gmode 7
gmule 178691
gp_read_str 0
gp_read_str_bitprec 0
gp_read_str_prec 0
gpolvar 4655
gshift_right 1392
gshiftle 7
gshiftre 7
gsub1e 20965
gsube 15455370
hex_number_len 108
hex_read 74
ifpari 13122672
ifpari_multi 30723
ifpari_void 42400609
initep 36622
insertep 2773825
install 0
int_read 31547593
is_entry 9220870
is_long 531130
is_ulong 1897
isbin 140359930
ishex 140359874
isreturn 2712660
kill0 14
killep 14
name_var 0
number 31715456
orpari 16723829
pari_add_function 0
pari_fill_hashtable 5681
pari_is_default 973
pari_isbdigit 1064
pari_lex 114175268
pari_set_varstate 369980
pari_var_close 1887
pari_var_create 484835
pari_var_init 1897
pari_var_next 4
pari_var_next_temp 0
readseq 804235
readseq_i 804235
real_0_digits 203
real_read 86710
real_read_more 5690
skipconstante 31534104
skipdigits 31540422
skipexponent 31532362
skipstring 3822307
strtobin_len 102
strtoi 31547593
strtor 86710
var_register 118
var_restore 383120
varentries_reset 118
varentries_set 9449
varentries_unset 16321
varhigher 105
varlower 34
vars_sort_inplace 1428
vars_to_RgXV 175
varstate_restore 13144
varstate_save 516266

Generated by: LCOV version 1.16