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) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31042-0fbe168e69) Lines: 71.8 % 2798 2008
Test Date: 2026-07-23 17:04:59 Functions: 80.0 % 310 248
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
GENtoGENstr_nospace 0
GENtoTeXstr 0
_initout 0
blancs 0
brute 0
dbg 0
dbgGEN 0
dbg_addr 0
dbg_pari_heap 0
dbg_word 0
dft_help 0
do_append 0
env_ok 0
err_flush 0
fputGEN_pariout 0
get_file 0
gp_dlopen 0
gp_embedded 0
gp_embedded_init 0
gp_getenv 0
gp_read_from_input 0
gp_read_str_history 0
gp_read_str_multiline 0
gpinstall 0
init_unique 0
install0 0
matbrute 0
ok_pipe 0
outmat 0
output 0
pari_ask_confirm 0
pari_dir_exists 0
pari_file_exists 0
pari_fopen 0
pari_fopen_or_fail 0
pari_fprintf 0
pari_get_histrtime 0
pari_get_histtime 0
pari_is_rwx 0
pari_nb_hist 0
pari_open_file 0
pari_safefopen 0
pari_tmp_dir 0
pari_unique_dir 0
pari_unique_filename 0
pari_unique_filename_suffix 0
pari_unlink 0
pari_vfprintf 0
print_coef 0
print_entree 0
print_functions_hash 0
prints 0
str_addr 0
strexpand 0
string_gets 0
strip_last_nl 0
switchout 0
texe 0
texparen 0
try_dlopen 0
uordinal 0
vsigne 0
GENtostr 4
externstr 4
gp_fileextern 4
gp_readvec_file 4
gpextern 4
readstr 4
strftime_expand 4
writetex 4
printp 7
switchin_last 7
term_height 7
term_height_intern 7
warning0 7
get_lines 8
try_pipe 8
write1 8
writeGEN 8
check_magic 12
decode_color 12
gpwritebin 12
is_sizeoflong_ok 12
log10_2 12
readbin 12
write_magic 12
writebin 12
error0 14
pari_sprint0 14
_cfwrite 16
file_is_binary 16
rdstr 16
writenamedGEN 16
wrstr 16
gp_read_file 19
forpath_init 20
forpath_next 20
path_is_absolute 20
try_name 20
try_open 20
pari_histtime 21
printsep1 21
is_long_ok 24
rdGEN 24
wrGEN 24
switchin 27
gpsystem 28
check_compress 36
readobj 36
check_secure 40
printtex 42
gp_fileflush 44
gp_filewrite 48
killallfiles 49
gp_fileflush0 52
gp_fileopen 52
gp_filewrite1 52
is_dir_stat 55
pari_is_dir 55
get_free_gp_file 56
gp_fileclose 56
gp_filereadstr 56
new_gp_file 56
gp_fileread 64
gtolong_OK 77
is_magic_ok 79
write0 82
rd_long 88
normalOutS 89
pari_is_file 94
print0_file 94
switchout_get_FILE 94
wr 94
get_texvar 105
wr_texnome 105
pari_fread_longs 112
wr_long 112
wr_lead_texnome 119
wr_check 122
strtex 126
zerotostr 126
_lfwrite 136
times_texnome 140
_fwrite 152
texnome 203
texVpowE 210
texexpo 210
gp_readvec_stream 305
texi 319
check_gp_file 320
err_printf 355
mat0n 392
texi_sign 516
real0tostr_width_frac 661
term_color 693
strprintf 721
GENtoGENstr 742
printf0 742
GENtostr_fun 746
pari_printf 753
pari_vprintf 753
printsep 1323
dopr_arg_vector 1463
gsprintf 1603
real0tostr 1756
v_get_arg 1876
pari_close_files 1887
pari_close_homedir 1887
initout 1895
pari_init_homedir 1895
pari_stdin_isatty 1895
resetout 1895
gvsprintf 2000
str_alloc0 2128
runaway_close 2204
in_help 2449
GENtostr_raw 3717
pari_get_homedir 3778
print_precontext 4613
print_context 5410
_expand_env 5798
_path_expand 5798
path_expand 5798
itostr 6804
fix_buffer 7420
new_line 7919
wr_vecsmall 8082
gp_read_stream 8887
gp_filter 11039
Str 11063
cxq_init 11088
RgV_to_str 11189
Str_fun 11189
delete_buffer 11265
new_buffer 11265
out_printf 12669
filestate_restore 13165
print_errcontext 13426
tmp_restore 13617
out_vprintf 14698
quote_string 14942
zeros 15537
paren 15995
print_prefixed_text 18825
pari_sprintf 19146
print1 20468
printfl_1 20468
out_print1 20496
term_width 22957
term_width_intern 22957
GENtostr_unquoted 26332
stack_GENtostr_fun_unquoted 26332
os_getenv 26762
absrtostr 35021
pari_get_infile 40361
pari_fclose 40383
pari_fopengz 40404
newfile 40460
pari_kill_file 40460
normalErrF 41154
stack_sprintf 42721
isdenom 53256
gen_output 60995
gen_output_fun 60995
pari_get_hist 60999
matbruti 61006
history 61041
pari_puts 62465
init_linewrap 62766
out_term_color 68398
stack_GENtostr_fun 72299
pari_vsprintf 78565
sm_dopr 80028
term_get_color 83206
get_var 101646
wr_lead_monome 102493
pari_putc 104877
pari_add_hist 108589
pari_fread_chars 112212
print 115438
printfl_0 115487
out_print0 116810
pari_last_was_newline 122635
absrtostr_width_frac 142743
get_sigd 143044
fmtreal 143128
shift_add 143485
fmtnum 146267
filestate_save 146737
str_printf 148096
str_print0 148603
pari_set_last_newline 151103
fmtstr 159381
str_putscut 159381
wr_dec 160464
strlen_real 173691
ex10 177729
wr_monome 180516
times_monome 186172
str_long 187493
str_ulong 187493
puts_lw 202807
pari_flush 205939
get_fun 209602
normalOutF 219978
monome 225266
str_arg_vprintf 228124
print_gcoef 239788
VpowE 240169
wrexpo 240169
_flush_log 261132
dosign 287421
outpad 289241
isfactor 298162
str_init 305951
normalErrS 311398
_fputs 311487
_puts_log 311487
pari_thread_close_files 378540
pari_init_files 378548
popinfile 380447
filestate_close 391705
out_puts 435608
str_absint 588038
normalErrC 624756
str_alloc 629548
out_putc 731216
kill_file_stack 757129
itostr_sign 770189
numdig 770189
gp_read_stream_buf 804589
init_filtre 806550
input_loop 951022
file_input 1000460
file_getline 1000536
bruti_intern 1008883
filtre0 1009295
set_last_newline 1164143
utodec 1167564
bruti 1191259
bruti_sign 1427915
print_0_or_pm1 1428431
isone 1658288
isnull_for_pol 1761542
str_puts 2539909
isnull 3727091
putc_lw 10149612
normalOutC 10229906
_putc_log 10854662
str_putc 15655472

Generated by: LCOV version 2.0-1