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 - es.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30465-b757eeabfc) Lines: 2058 2801 73.5 %
Date: 2025-08-12 09:23:53 Functions: 254 310 81.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GENtoGENstr 742
GENtoGENstr_nospace 0
GENtoTeXstr 0
GENtostr 4
GENtostr_fun 746
GENtostr_raw 3696
GENtostr_unquoted 25983
RgV_to_str 11202
Str 11064
Str_fun 11190
VpowE 233125
_cfwrite 8
_expand_env 5819
_flush_log 255291
_fputs 309717
_fwrite 104
_initout 0
_lfwrite 96
_path_expand 5819
_putc_log 10596069
_puts_log 309717
absrtostr 34608
absrtostr_width_frac 142736
blancs 0
brute 0
bruti 1166238
bruti_intern 982600
bruti_sign 1393864
check_compress 36
check_gp_file 320
check_magic 12
check_secure 40
cxq_init 11046
dbg 0
dbgGEN 0
dbg_addr 0
dbg_pari_heap 0
dbg_word 0
decode_color 12
delete_buffer 11268
dft_help 20
do_append 0
dopr_arg_vector 1463
dosign 287127
env_ok 0
err_flush 0
err_printf 347
error0 14
ex10 177309
externstr 4
file_getline 997503
file_input 997427
file_is_binary 16
filestate_close 352481
filestate_restore 13110
filestate_save 144656
filtre0 1006259
fix_buffer 7392
fmtnum 145973
fmtreal 143121
fmtstr 158995
forpath_init 20
forpath_next 20
fputGEN_pariout 0
gen_output 60691
gen_output_fun 60691
get_file 0
get_free_gp_file 56
get_fun 204540
get_lines 8
get_sigd 143037
get_texvar 105
get_var 97843
gp_dlopen 20
gp_embedded 0
gp_embedded_init 0
gp_fileclose 56
gp_fileextern 4
gp_fileflush 44
gp_fileflush0 52
gp_fileopen 52
gp_fileread 64
gp_filereadstr 56
gp_filewrite 48
gp_filewrite1 52
gp_filter 11039
gp_getenv 8
gp_read_file 19
gp_read_from_input 0
gp_read_str_history 0
gp_read_str_multiline 0
gp_read_stream 8887
gp_read_stream_buf 804589
gp_readvec_file 4
gp_readvec_stream 305
gpextern 4
gpinstall 20
gpsystem 28
gpwritebin 12
gsprintf 1603
gtolong_OK 77
gvsprintf 1993
history 60745
in_help 2386
init_filtre 806553
init_linewrap 62453
init_unique 0
initout 1900
input_loop 948948
install0 20
is_dir_stat 55
is_long_ok 24
is_magic_ok 79
is_sizeoflong_ok 12
isdenom 52836
isfactor 285527
isnull 3653720
isnull_for_pol 1748100
isone 1611533
itostr 6804
itostr_sign 755716
kill_file_stack 679619
killallfiles 49
log10_2 12
mat0n 392
matbrute 0
matbruti 60702
monome 218110
new_buffer 11268
new_gp_file 56
new_line 7920
newfile 40460
normalErrC 622038
normalErrF 40653
normalErrS 309606
normalOutC 9974031
normalOutF 214638
normalOutS 111
numdig 755716
ok_pipe 0
os_getenv 26661
out_print0 112284
out_print1 20251
out_printf 12455
out_putc 728206
out_puts 429396
out_term_color 67858
out_vprintf 14312
outmat 0
outpad 288940
output 0
paren 15547
pari_add_hist 106911
pari_ask_confirm 0
pari_close_files 1890
pari_close_homedir 1890
pari_dir_exists 0
pari_fclose 40383
pari_file_exists 0
pari_flush 200822
pari_fopen 0
pari_fopen_or_fail 0
pari_fopengz 40404
pari_fprintf 0
pari_fread_chars 112204
pari_fread_longs 72
pari_get_hist 60695
pari_get_histrtime 0
pari_get_histtime 0
pari_get_homedir 3792
pari_get_infile 40361
pari_histtime 25
pari_init_files 342645
pari_init_homedir 1900
pari_is_dir 55
pari_is_file 94
pari_is_rwx 0
pari_kill_file 40460
pari_last_was_newline 120734
pari_nb_hist 0
pari_open_file 0
pari_printf 757
pari_putc 104553
pari_puts 62171
pari_safefopen 0
pari_set_last_newline 148984
pari_sprint0 14
pari_sprintf 19104
pari_stdin_isatty 1900
pari_thread_close_files 341737
pari_tmp_dir 0
pari_unique_dir 0
pari_unique_filename 0
pari_unique_filename_suffix 0
pari_unlink 0
pari_vfprintf 0
pari_vprintf 757
pari_vsprintf 78017
path_expand 5819
path_is_absolute 20
popinfile 343530
print 111269
print0_file 94
print1 20223
print_0_or_pm1 1394380
print_coef 0
print_context 5410
print_entree 0
print_errcontext 13371
print_functions_hash 0
print_gcoef 237606
print_precontext 4613
print_prefixed_text 18774
printf0 742
printfl_0 111318
printfl_1 20223
printp 7
prints 0
printsep 966
printsep1 21
printtex 42
putc_lw 9895917
puts_lw 197772
quote_string 14958
rdGEN 16
rd_long 56
rdstr 8
readbin 12
readobj 28
readstr 4
real0tostr 1581
real0tostr_width_frac 661
resetout 1900
runaway_close 2207
set_last_newline 1154921
shift_add 143478
sm_dopr 79480
stack_GENtostr_fun 71911
stack_GENtostr_fun_unquoted 25983
stack_sprintf 42608
str_absint 573810
str_addr 0
str_alloc 614907
str_alloc0 2115
str_arg_vprintf 227575
str_init 300167
str_long 182005
str_print0 143845
str_printf 148096
str_putc 15379377
str_puts 2490732
str_putscut 158994
str_ulong 182005
strexpand 12
strftime_expand 4
string_gets 0
strip_last_nl 0
strlen_real 173443
strprintf 721
strtex 126
switchin 27
switchin_last 7
switchout 0
switchout_get_FILE 94
term_color 709
term_get_color 82602
term_height 7
term_height_intern 7
term_width 22826
term_width_intern 22826
texVpowE 210
texe 0
texexpo 210
texi 319
texi_sign 516
texnome 203
texparen 0
times_monome 177429
times_texnome 140
tmp_restore 13555
try_dlopen 0
try_name 20
try_open 20
try_pipe 8
uordinal 0
utodec 1141108
v_get_arg 1876
vsigne 0
warning0 7
wr 94
wrGEN 16
wr_check 122
wr_dec 160450
wr_lead_monome 98697
wr_lead_texnome 119
wr_long 80
wr_monome 174020
wr_texnome 105
wr_vecsmall 8068
wrexpo 233125
write0 82
write1 8
writeGEN 8
write_magic 12
writebin 12
writenamedGEN 8
writetex 4
wrstr 8
zeros 15306
zerotostr 126

Generated by: LCOV version 1.16