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 30452-bc38797c51) Lines: 636 693 91.8 %
Date: 2025-08-08 09:23:34 Functions: 95 101 94.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
gp_read_str 0
gp_read_str_bitprec 0
gp_read_str_prec 0
name_var 0
pari_add_function 0
pari_var_next_temp 0
fetch_var_value 7
gdivente 7
gdivrounde 7
gmode 7
gshiftle 7
gshiftre 7
check_name 8
pari_var_next 8
kill0 18
killep 18
install 20
alias0 28
arity0 28
bin_read 28
varlower 34
eval_mnemonic 35
bin_number_len 37
_lower 42
_higher 49
addhelp 50
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 196
IS_ID 457
pari_is_default 972
pari_isbdigit 1064
gpolvar 1183
gshift_right 1392
vars_sort_inplace 1428
pari_var_close 1890
pari_var_init 1900
is_ulong 1912
_given_value 3010
real_read_more 4955
cmp_by_var 5150
pari_fill_hashtable 5690
varentries_set 9371
compile_str 10992
varstate_restore 13089
varentries_unset 16259
gsub1e 20965
ifpari_multi 30723
initep 36204
exponent 75558
real_read 85919
strtor 85919
fetch_var 87403
gmule 178691
pari_set_varstate 340736
var_restore 353822
fetch_user_var 453824
fetch_entry 453938
pari_var_create 484379
varstate_save 485329
is_long 528174
gadde 536517
readseq 804235
readseq_i 804235
dec_read_more 1041925
dec_strtoi_len 1041925
check_proto 2688470
isreturn 2688470
fill_hashtable_single 2713150
insertep 2749236
skipstring 3822061
dec_number_len 4137833
fetch_var_higher 8422810
delete_var 8510277
is_entry 9167044
ifpari 13078322
gsube 15455370
orpari 16723451
do_alias 21957011
fetch_entry_raw 22371803
gadd1e 25685202
skipexponent 31525399
skipconstante 31527127
skipdigits 31532682
findentry 31539822
int_read 31541274
strtoi 31541274
dec_read 31632046
number 31707604
ifpari_void 42380292
andpari 64287458
pari_lex 114139007
ishex 140326696
isbin 140326752

Generated by: LCOV version 1.16