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 30702-bddb8d6928) Lines: 616 695 88.6 %
Date: 2026-02-23 02:23:56 Functions: 91 101 90.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
IS_ID 55
_given_value 2573
_higher 35
_lower 30
addhelp 36
alias0 23
andpari 46201524
arity0 20
bin_number_len 32
bin_read 24
binary_read 80
check_name 0
check_proto 2112960
cmp_by_var 3701
compile_str 9382
dec_number_len 3503721
dec_read 26980418
dec_read_more 884872
dec_strtoi_len 884872
delete_var 7222017
do_alias 18686844
eval_mnemonic 5
exponent 61319
fetch_entry 379160
fetch_entry_raw 19033503
fetch_user_var 379078
fetch_var 73871
fetch_var_higher 7148124
fetch_var_value 5
fill_hashtable_single 2132304
findentry 26401268
gadd1e 21564178
gadde 458195
gdive 48
gdivente 5
gdivrounde 5
gmode 5
gmule 152532
gp_read_str 0
gp_read_str_bitprec 0
gp_read_str_prec 0
gpolvar 949
gshift_right 994
gshiftle 5
gshiftre 5
gsub1e 16868
gsube 11080107
hex_number_len 84
hex_read 56
ifpari 11200307
ifpari_multi 26326
ifpari_void 35057697
initep 29636
insertep 2161854
install 0
int_read 26907257
is_entry 7367002
is_long 415152
is_ulong 1488
isbin 119759571
ishex 119759523
isreturn 2112960
kill0 10
killep 10
name_var 0
number 27041737
orpari 14044726
pari_add_function 0
pari_fill_hashtable 4464
pari_is_default 763
pari_isbdigit 912
pari_lex 97406772
pari_set_varstate 0
pari_var_close 1488
pari_var_create 403434
pari_var_init 1488
pari_var_next 0
pari_var_next_temp 0
readseq 688573
readseq_i 688573
real_0_digits 149
real_read 69458
real_read_more 3783
skipconstante 26894047
skipdigits 26899108
skipexponent 26892699
skipstring 3263664
strtobin_len 80
strtoi 26907257
strtor 69458
var_register 86
var_restore 10866
varentries_reset 86
varentries_set 7646
varentries_unset 13561
varhigher 81
varlower 20
vars_sort_inplace 1201
vars_to_RgXV 127
varstate_restore 10866
varstate_save 119258

Generated by: LCOV version 1.16