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 - init.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30702-bddb8d6928) Lines: 1013 1487 68.1 %
Date: 2026-02-23 02:23:56 Functions: 116 162 71.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
bl_rotleft 53837637
bl_rotright 49684996
blockbalance 2286583052
blockdelete 1260748252
blockheight 9524407338
blockinsert 1386159369
cgetg_copy_avma 875316867
cgetlist_avma 524
chk_gc_upto 0
clone_lock 260131526
clone_unlock 212313619
clone_unlock_deep 48198788
clonesearch 520643933
copy_bin 391359253
copy_bin_canon 0
dbg_fill_stack 0
dbg_gc_upto 0
dbg_stack 0
debug_stack 0
dflt_err_recover 0
dflt_pari_quit 0
dflt_sigint_fun 0
dochk_gc_upto 0
err_init 11451
err_init_msg 11338
err_recover 10800
errname 23212
export_add 30
export_del 0
export_get 252
exportall 0
f_getheap 5292
fix_height 2475620617
fix_size 3696
gc_all_unsafe 22944075
gc_dec 5047327933
gc_slice_unsafe 275626549
gc_stack_update 1044042250
gclone 189113024
gclone_refc 0
gcloneref 31770
gcopy 3688308934
gcopy_av0 3310323633
gcopy_av0_canon 0
gcopy_avma 2478993915
gcopy_lg 636
gdisplay 2844
gerepile 0
getabstime 1488
getdebugvar 0
getheap 67
getstack 5
gettime 2964
getwalltime 0
gp_context_restore 10866
gp_context_save 119258
gsizebyte 136
gsizeclone 189113024
gsizeclone_i 2553484427
gsizeword 1898075
gunclone 302580791
gunclone_deep 2426616120
icopy_avma_canon 0
init_universal_constants 1488
is_in_block 173973251
list_internal_copy 5318
listassign 5318
listcopy 612
listinit 0
msgtimer 0
name_numerr 0
new_chunk_resize 11
newblock 189166135
numerr_name 23212
obj_check 5169570
obj_checkbuild 1290769
obj_checkbuild_padicprec 462
obj_checkbuild_prec 487229
obj_checkbuild_realprec 342087
obj_free 160506
obj_init 2169555
obj_insert 2280421
obj_insert_shallow 148597
obj_reinit 36
os_signal 16368
pari_add_defaults_module 1488
pari_add_module 1488
pari_close 1488
pari_close_blocks 1488
pari_close_export 1488
pari_close_opts 1488
pari_daemon 0
pari_err 47784
pari_err2GEN 47778
pari_err2str 17910
pari_err_display 10818
pari_err_last 73933
pari_exit 0
pari_handle_SIGINT 0
pari_init 0
pari_init_blocks 1488
pari_init_defaults 1488
pari_init_errcatch 1854
pari_init_export 1488
pari_init_functions 1488
pari_init_opts 1488
pari_init_timer 1488
pari_mainstack_alloc 1848
pari_mainstack_free 1848
pari_mainstack_malloc 1848
pari_mainstack_mextend 101241
pari_mainstack_mfree 1848
pari_mainstack_mreset 101241
pari_mainstack_resize 360
pari_mainstack_setsize 101241
pari_mainstack_use 1488
pari_sig_init 2976
pari_sighandler 0
pari_sigint 0
pari_stackcheck_init 2976
pari_thread_alloc 0
pari_thread_close 1488
pari_thread_free 0
pari_thread_get_global 0
pari_thread_init 1488
pari_thread_set_global 0
pari_thread_start 0
pari_thread_valloc 0
pari_version 5
pari_warn 633
paristack_alloc 1488
paristack_newrsize 366
paristack_resize 0
paristack_setsize 0
parivstack_reset 99393
parivstack_resize 0
pop_entree_block 330785
rndus 180918
setalldebug 1509
setdebug 85
setdebugvar 0
shiftaddress 2558194036
shiftaddress_canon 0
taille0 3310323633
taille0_canon 0
timer 0
timer2 0
timer_aux 180918
timer_delay 91197
timer_get 1488
timer_printf 0
timer_start 294567
timer_vprintf 0
timetoi 0
traverseheap 67
traverseheap_r 10651
type_dim 6206
unexportall 0
vec_gunclone_deep 111734024
walltimer_delay 88233
walltimer_get 0
walltimer_start 206939

Generated by: LCOV version 1.16