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 - eval.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 29906-a42b18f581) Lines: 1299 1888 68.8 %
Date: 2025-01-30 09:09:36 Functions: 116 154 75.3 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
_bitprecision0 676
_prec 11276
_precision0 1246
bincopy_relink 0
bitprecision0 42
bitprecision00 718
break0 70358
change_compo 9701412
changelex 161835445
changevalue 29488662
check_array_index 106145301
checkprec 11183
checkvalue 123286007
checkvalueptr 23308327
closure_callgen0 7
closure_callgen0prec 168
closure_callgen1 8537704
closure_callgen1prec 76681
closure_callgen2 67073
closure_callgenall 12
closure_callgenvec 4587343
closure_callgenvecdef 322
closure_callgenvecdefprec 322
closure_callgenvecprec 0
closure_callvoid1 0
closure_castgen 92909625
closure_castlong 5873
closure_context 91
closure_disassemble 0
closure_err 12691
closure_eval 312055784
closure_evalbrk 175
closure_evalgen 34051778
closure_evalnobrk 76017731
closure_evalres 932585
closure_evalvoid 152329290
closure_func_err 13388
closure_relink 0
closure_return 49643418
closure_returnupto 13269282
closure_unlink 0
closure_varn 1139121
copybin_unlink 12
copylex 9790697
copyupto 41052601
copyvalue 745367
disassemble_cast 0
err_var 0
evalstate_clone 0
evalstate_get_trace 977141
evalstate_reset 438
evalstate_restore 56093
evalstate_restore_err 43243
evalstate_save 1427088
evalstate_set_trace 18
freeep 35363
freelex 180845159
gen_relink 0
gen_unlink 16
get_and_reset_break 41666
get_arg_name 21
get_lex 98937071
get_localbitprec 22266284
get_localprec 21904763
get_next_label 251
getlocalbitprec 3346
getlocalprec 14
gp_call 112134
gp_call2 91
gp_callbool 872130
gp_callprec 23478
gp_callvoid 0
gp_eval 39688178
gp_evalbool 26165027
gp_evalprec 20734
gp_evalupto 2052195
gp_evalvoid 3693816
gp_evalvoid2 8455
hash_from_link 0
localbitprec 3345
localprec 7847
loop_break 145889499
lvar_make_safe 0
negcmp 0
new_ptr 58684368
new_val_cell 18684
next0 25853
opcode_need_relink 0
pareval 6
pareval_worker 12
parfor 346
parfor0 346
parfor_init 0
parfor_next 0
parfor_stop 0
parfor_worker 9613
parforeach 7
parforeach0 7
parforeach_init 0
parforeach_next 0
parforeach_stop 0
parforiter_init 0
parforiter_next 0
parforiter_stop 0
parforprime 13
parforprime0 13
parforprime_init 0
parforprime_next 0
parforprime_stop 0
parforprimestep 20
parforprimestep0 7
parforprimestep_init 0
parforstep 39
parforstep0 39
parforstep_init 0
parforstep_next 0
parforstep_stop 0
parforvec 39
parforvec0 39
parforvec_init 0
parforvec_next 0
parforvec_stop 0
pari_close_evaluator 330475
pari_init_evaluator 334346
pari_self 41
parsum 2062
parsum_slice_worker 7533
parvector 31
parvector_worker 629
pop_lex 5602675
pop_localprec 98976
pop_val 18243
pop_val_if_newer 401974
precision0 42
precision00 1288
ptr_proplock 9906316
push_lex 5770040
push_localbitprec 442655
push_localprec 99025
pushlex 63470387
pushvalue 42
reset_break 98197
restore_trace 5658768
restore_vars 312126225
return0 40898
safeel 0
safegcoeff 0
safegel 0
safelistel 0
set_lex 83226401
setreflex 504
st_alloc 2972551127
trace_push 317600161
zerovalue 14

Generated by: LCOV version 1.16