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 30861-40e9da58f9) Lines: 2009 2799 71.8 %
Date: 2026-05-04 09:27:01 Functions: 248 310 80.0 %
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 3710
GENtostr_unquoted 26318
RgV_to_str 11196
Str 11070
Str_fun 11196
VpowE 235066
_cfwrite 16
_expand_env 5798
_flush_log 258052
_fputs 311224
_fwrite 152
_initout 0
_lfwrite 136
_path_expand 5798
_putc_log 10657409
_puts_log 311224
absrtostr 35014
absrtostr_width_frac 142743
blancs 0
brute 0
bruti 1172646
bruti_intern 989936
bruti_sign 1403443
check_compress 36
check_gp_file 320
check_magic 12
check_secure 40
cxq_init 11088
dbg 0
dbgGEN 0
dbg_addr 0
dbg_pari_heap 0
dbg_word 0
decode_color 12
delete_buffer 11265
dft_help 0
do_append 0
dopr_arg_vector 1463
dosign 287379
env_ok 0
err_flush 0
err_printf 355
error0 14
ex10 177722
externstr 4
file_getline 1000032
file_input 999956
file_is_binary 16
filestate_close 380919
filestate_restore 13144
filestate_save 146338
filtre0 1008791
fix_buffer 7420
fmtnum 146225
fmtreal 143128
fmtstr 159345
forpath_init 20
forpath_next 20
fputGEN_pariout 0
gen_output 61632
gen_output_fun 61632
get_file 0
get_free_gp_file 56
get_fun 206648
get_lines 8
get_sigd 143044
get_texvar 105
get_var 99294
gp_dlopen 0
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 0
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 0
gpsystem 28
gpwritebin 12
gsprintf 1603
gtolong_OK 77
gvsprintf 2000
history 61678
in_help 2442
init_filtre 806550
init_linewrap 63403
init_unique 0
initout 1897
input_loop 950623
install0 0
is_dir_stat 55
is_long_ok 24
is_magic_ok 79
is_sizeoflong_ok 12
isdenom 53186
isfactor 289524
isnull 3672722
isnull_for_pol 1750902
isone 1625922
itostr 6804
itostr_sign 760916
kill_file_stack 737247
killallfiles 49
log10_2 12
mat0n 392
matbrute 0
matbruti 61643
monome 220079
new_buffer 11265
new_gp_file 56
new_line 7919
newfile 40460
normalErrC 623769
normalErrF 41091
normalErrS 311125
normalOutC 10033640
normalOutF 216961
normalOutS 99
numdig 760916
ok_pipe 0
os_getenv 26741
out_print0 113212
out_print1 20496
out_printf 12655
out_putc 730866
out_puts 432482
out_term_color 68314
out_vprintf 14684
outmat 0
outpad 289199
output 0
paren 15876
pari_add_hist 108267
pari_ask_confirm 0
pari_close_files 1887
pari_close_homedir 1887
pari_dir_exists 0
pari_fclose 40383
pari_file_exists 0
pari_flush 202943
pari_fopen 0
pari_fopen_or_fail 0
pari_fopengz 40404
pari_fprintf 0
pari_fread_chars 112212
pari_fread_longs 112
pari_get_hist 61636
pari_get_histrtime 0
pari_get_histtime 0
pari_get_homedir 3778
pari_get_infile 40361
pari_histtime 21
pari_init_files 373054
pari_init_homedir 1897
pari_is_dir 55
pari_is_file 94
pari_is_rwx 0
pari_kill_file 40460
pari_last_was_newline 122292
pari_nb_hist 0
pari_open_file 0
pari_printf 753
pari_putc 105514
pari_puts 63112
pari_safefopen 0
pari_set_last_newline 150669
pari_sprint0 14
pari_sprintf 19132
pari_stdin_isatty 1897
pari_thread_close_files 371606
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 753
pari_vsprintf 78523
path_expand 5798
path_is_absolute 20
popinfile 373287
print 111840
print0_file 94
print1 20468
print_0_or_pm1 1403959
print_coef 0
print_context 5410
print_entree 0
print_errcontext 13405
print_functions_hash 0
print_gcoef 237849
print_precontext 4613
print_prefixed_text 18804
printf0 742
printfl_0 111889
printfl_1 20468
printp 7
prints 0
printsep 1323
printsep1 21
printtex 42
putc_lw 9955278
puts_lw 199846
quote_string 14942
rdGEN 24
rd_long 88
rdstr 16
readbin 12
readobj 36
readstr 4
real0tostr 1693
real0tostr_width_frac 661
resetout 1897
runaway_close 2204
set_last_newline 1160667
shift_add 143485
sm_dopr 79986
stack_GENtostr_fun 72929
stack_GENtostr_fun_unquoted 26318
stack_sprintf 42707
str_absint 578709
str_addr 0
str_alloc 620212
str_alloc0 2115
str_arg_vprintf 228081
str_init 302934
str_long 183363
str_print0 145012
str_printf 148096
str_putc 15458770
str_puts 2505001
str_putscut 159345
str_ulong 183363
strexpand 0
strftime_expand 4
string_gets 0
strip_last_nl 0
strlen_real 173586
strprintf 721
strtex 126
switchin 27
switchin_last 7
switchout 0
switchout_get_FILE 94
term_color 693
term_get_color 83087
term_height 7
term_height_intern 7
term_width 22932
term_width_intern 22932
texVpowE 210
texe 0
texexpo 210
texi 319
texi_sign 516
texnome 203
texparen 0
times_monome 180264
times_texnome 140
tmp_restore 13596
try_dlopen 0
try_name 20
try_open 20
try_pipe 8
uordinal 0
utodec 1148659
v_get_arg 1876
vsigne 0
warning0 7
wr 94
wrGEN 24
wr_check 122
wr_dec 160520
wr_lead_monome 100141
wr_lead_texnome 119
wr_long 112
wr_monome 175770
wr_texnome 105
wr_vecsmall 8082
wrexpo 235066
write0 82
write1 8
writeGEN 8
write_magic 12
writebin 12
writenamedGEN 16
writetex 4
wrstr 16
zeros 15537
zerotostr 126

Generated by: LCOV version 1.16