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.16.2 lcov report (development 29420-55f63b8cfe) Lines: 1167 1497 78.0 %
Date: 2024-07-03 09:03:24 Functions: 137 163 84.0 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
bl_rotleft 63534666
bl_rotright 60533356
blockbalance 2741317715
blockdelete 1522251138
blockheight 11420283343
blockinsert 1663008989
blocksearch 752706982
cgetg_copy_avma 984771889
cgetlist_avma 620
check_clone 1747549
chk_gerepileupto 0
clone_lock 376529583
clone_unlock 317253110
clone_unlock_deep 59295466
copy_bin 448617557
copy_bin_canon 16
dbg_fill_stack 0
dbg_gerepile 0
dbg_gerepileupto 0
debug_stack 0
dec_gerepile 4899841014
dflt_err_recover 0
dflt_pari_quit 0
dflt_sigint_fun 0
dochk_gerepileupto 0
err_init 13046
err_init_msg 12906
err_recover 12279
errname 27109
export_add 59
export_del 24
export_get 1500
exportall 6
f_getheap 6664
fix_height 2968876216
fix_size 649766
gclone 231444598
gclone_refc 0
gcloneref 37887
gcopy 4477034869
gcopy_av0 3735091965
gcopy_av0_canon 32
gcopy_avma 3265070113
gcopy_lg 742
gdisplay 3682
gerepile 1204050770
gerepileallsp 6306398
gerepilecoeffssp 307288975
gerepilemanysp 21488767
getabstime 1863
getdebugvar 322613
getheap 84
getstack 7
gettime 3620
getwalltime 8
gp_context_restore 12354
gp_context_save 136711
gsizebyte 168
gsizeclone 231444346
gsizeclone_i 3351776483
gsizeword 2240217
gunclone 382088924
gunclone_deep 3241144447
icopy_avma_canon 12
init_universal_constants 1851
list_internal_copy 6676
listassign 6676
listcopy 730
listinit 0
msgtimer 0
name_numerr 21
new_chunk_resize 14
newblock 232184590
numerr_name 27109
obj_check 4506610
obj_checkbuild 1032135
obj_checkbuild_padicprec 546
obj_checkbuild_prec 507417
obj_checkbuild_realprec 398512
obj_free 186340
obj_init 1621909
obj_insert 1747549
obj_insert_shallow 189945
obj_reinit 42
os_signal 20301
pari_add_defaults_module 1851
pari_add_module 1841
pari_close 1841
pari_close_blocks 317809
pari_close_export 1841
pari_close_opts 1841
pari_daemon 76
pari_err 48995
pari_err2GEN 48976
pari_err2str 21078
pari_err_display 12300
pari_err_last 73370
pari_exit 0
pari_handle_SIGINT 0
pari_init 0
pari_init_blocks 324451
pari_init_defaults 1851
pari_init_errcatch 324876
pari_init_export 1851
pari_init_functions 1851
pari_init_opts 1851
pari_init_timer 1851
pari_mainstack_alloc 324888
pari_mainstack_free 324878
pari_mainstack_malloc 324888
pari_mainstack_mextend 438382
pari_mainstack_mfree 324878
pari_mainstack_mreset 438382
pari_mainstack_resize 424
pari_mainstack_setsize 438382
pari_mainstack_use 324456
pari_sig_init 3692
pari_sighandler 0
pari_sigint 0
pari_stackcheck_init 326304
pari_thread_alloc 322613
pari_thread_close 322777
pari_thread_free 322613
pari_thread_get_global 322613
pari_thread_init 324456
pari_thread_set_global 322366
pari_thread_start 322603
pari_thread_valloc 0
pari_version 7
pari_warn 746
paristack_alloc 1851
paristack_newrsize 431
paristack_resize 0
paristack_setsize 0
parivstack_reset 113494
parivstack_resize 0
pop_entree_block 315637
rndus 207083
setalldebug 1879
setdebug 127
setdebugvar 322368
shiftaddress 2910085957
shiftaddress_canon 24
taille0 3735598436
taille0_canon 32
timer 0
timer2 0
timer_aux 207075
timer_delay 104413
timer_get 1869
timer_printf 0
timer_start 340861
timer_vprintf 0
timetoi 8
trap0 21
traverseheap 84
traverseheap_r 13412
type_dim 7322
unexportall 6
vec_gunclone_deep 127307548
walltimer_delay 100793
walltimer_get 0
walltimer_start 236864

Generated by: LCOV version 1.16