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 30759-17b423fb9b) Lines: 2011 2801 71.8 %
Date: 2026-03-20 09:26:27 Functions: 248 310 80.0 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by 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
_cfwrite 8
get_lines 8
rdstr 8
try_pipe 8
write1 8
writeGEN 8
writenamedGEN 8
wrstr 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
file_is_binary 16
rdGEN 16
wrGEN 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
switchin 27
gpsystem 28
readobj 28
check_compress 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
rd_long 56
gp_fileread 64
pari_fread_longs 72
gtolong_OK 77
is_magic_ok 79
wr_long 80
write0 82
pari_is_file 94
print0_file 94
switchout_get_FILE 94
wr 94
_lfwrite 96
normalOutS 99
_fwrite 104
get_texvar 105
wr_texnome 105
wr_lead_texnome 119
wr_check 122
strtex 126
zerotostr 126
times_texnome 140
texnome 203
texVpowE 210
texexpo 210
gp_readvec_stream 305
texi 319
check_gp_file 320
err_printf 347
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 1651
v_get_arg 1876
pari_close_files 1880
pari_close_homedir 1880
initout 1890
pari_init_homedir 1890
pari_stdin_isatty 1890
resetout 1890
gvsprintf 2000
str_alloc0 2115
runaway_close 2197
in_help 2421
GENtostr_raw 3710
pari_get_homedir 3764
print_precontext 4613
print_context 5410
_expand_env 5777
_path_expand 5777
path_expand 5777
itostr 6804
fix_buffer 7413
new_line 7919
wr_vecsmall 8082
gp_read_stream 8887
cxq_init 11032
gp_filter 11039
Str 11070
RgV_to_str 11196
Str_fun 11196
delete_buffer 11258
new_buffer 11258
out_printf 12669
filestate_restore 13144
print_errcontext 13405
tmp_restore 13596
out_vprintf 14704
quote_string 14938
zeros 15411
paren 15575
print_prefixed_text 18804
pari_sprintf 19132
print1 20279
printfl_1 20279
out_print1 20307
term_width 22890
term_width_intern 22890
GENtostr_unquoted 26304
stack_GENtostr_fun_unquoted 26304
os_getenv 26685
absrtostr 34671
pari_get_infile 40361
pari_fclose 40383
pari_fopengz 40404
newfile 40460
pari_kill_file 40460
normalErrF 41119
stack_sprintf 42707
isdenom 52990
gen_output 61478
gen_output_fun 61478
pari_get_hist 61482
matbruti 61489
history 61524
pari_puts 62958
init_linewrap 63242
out_term_color 68342
stack_GENtostr_fun 72768
pari_vsprintf 78543
sm_dopr 80006
term_get_color 83115
get_var 98899
wr_lead_monome 99746
pari_putc 105360
pari_add_hist 107987
print 111602
printfl_0 111651
pari_fread_chars 112204
out_print0 112974
pari_last_was_newline 122026
absrtostr_width_frac 142743
get_sigd 143044
fmtreal 143128
shift_add 143485
str_print0 144585
filestate_save 145967
fmtnum 146225
str_printf 148096
pari_set_last_newline 150305
fmtstr 159352
str_putscut 159352
wr_dec 160345
strlen_real 173586
wr_monome 174713
ex10 177379
times_monome 178934
str_long 182663
str_ulong 182663
puts_lw 199265
pari_flush 202362
get_fun 206067
normalOutF 216394
monome 218956
str_arg_vprintf 228102
VpowE 233971
wrexpo 233971
print_gcoef 237849
_flush_log 257513
isfactor 287326
dosign 287379
outpad 289199
str_init 302324
normalErrS 311201
_fputs 311300
_puts_log 311300
pari_thread_close_files 373302
pari_init_files 374513
popinfile 374879
filestate_close 383521
out_puts 431949
str_absint 577042
str_alloc 618202
normalErrC 623797
out_putc 730740
kill_file_stack 740786
itostr_sign 758948
numdig 758948
gp_read_stream_buf 804589
init_filtre 806543
input_loop 950252
bruti_intern 986729
file_input 999214
file_getline 999290
filtre0 1008056
utodec 1145487
set_last_newline 1160008
bruti 1170007
bruti_sign 1399257
print_0_or_pm1 1399773
isone 1620288
isnull_for_pol 1749023
str_puts 2498921
isnull 3664597
putc_lw 9926626
normalOutC 10004792
_putc_log 10628589
str_putc 15430388

Generated by: LCOV version 1.16