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 - basemath - arith1.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30112-ee56c7c1f9) Lines: 2080 2283 91.1 %
Date: 2025-04-03 09:18:57 Functions: 218 232 94.0 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fl_log_Fp 0
Fl_sqrtl 0
Z_ZV_mod 0
Z_nv_mod 0
gcf2 0
nmV_chinese_center_tree 0
nxCV_chinese_center 0
nxCV_chinese_center_tree 0
pnqn 0
rootsof1_Fp 0
sersfcont 0
sqrt_Cipolla 0
sqrt_Cipolla_msqr 0
sqrt_Cipolla_sqr 0
bestappr_frac 7
fibo 7
sfcont2 14
intmod2polmod 21
padic2mod 21
gc_empty 42
mod_to_frac 42
contfrac0 49
serPade 49
err_oo 56
lucas 56
Fp_log_index 63
Fp_log_sieve 63
check_kernel 63
compute_nbgen 63
opt_param 63
znorder 63
Fp_factored_order 70
Zp_order 70
nxMV_chinese_center 90
nxMV_polint_center_tree 90
bestappr_ser 98
get_PHI 98
Fp_pow_init 105
mpprimorial 105
_gc_upto 112
mod_to_rfrac 112
bestapprPade 119
bestappr_RgX 119
Fp_log_find_ind 126
Fp_log_find_rel 126
bestapprPade0 126
gcf 126
znlog_rec 126
_Fp_rand 160
err_p 161
err_prec 196
lift_padic 210
znlog 238
gener_Zp 259
contfracpnqn 266
Fp_gausssum 284
znprimroot 329
factorial_Fp 382
lift_intmod 420
ZXM_nv_mod_tree 431
nxMV_chinese_center_tree_seq 431
nxMV_polint_center_tree_seq 431
FpV_prod 497
muls_interval 560
Fp_rootsof1 760
ECP_psi 837
_computeG 837
nxMV_polint_center_tree_worker 840
nonsquare_Fp 1339
_psi 1714
odd_prime_divisors 1812
remove2 1812
Z_chinese 2142
addifsmooth1 2163
chinese1 2415
rootsof1u_Fp 3033
Fp_2gener 3187
ZXC_nv_mod_tree 4054
nxCV_polint_center_tree 4620
is_gener_expo 4909
ZV_chinese 5141
ZVV_nv_mod_tree 5457
ncV_chinese_center_tree 5457
chinese 5495
Fp_2gener_all 5747
Fp_powers 5931
get_Fp_field 6963
mphilbertoo 7329
nonsquare_Fl 7930
ncV_chinese_center 10200
Fp_invmBarrett 13825
is_gener_Fp 13962
Fp_sqrts 18181
_Fp_s 19075
Fp_2gener_i 19392
Fl_log_naive_pre 26275
Fl_log_pre 26673
Fp_log_sieve_worker 30254
_Fp_inv 34307
kroui 35396
krois 39753
Fp_pow_table 43694
pgener_Fp 44247
_Fp_one 47162
factorial_Fl 56838
Fp_log_halfgcd 57945
tr 59731
hilbert 62314
Fl_2gener_pre_i 65765
istotient 70000
Fp_sqrt_ii 75175
addifsmooth2 83825
ZXX_nv_mod_tree 86823
mulu_interval_step 90701
bestappr 104841
Fp_order 132166
Fl_log 132404
Fl_log_naive 132404
hilbertii 140826
nmV_chinese_center_tree_seq 142031
nmV_polint_center_tree_seq 142031
Fl_lgener_pre_all 142652
krosi 143239
ZV_chinese_center 157219
mulu_interval 158951
rt 169813
pgener_Zp 170933
Fp_sqrtn 173541
Fl_2gener_pre 178524
krouodd 178635
pgener_Zl 205689
rootsof1_Fl 215528
nxV_chinese_center_tree 218874
Fl_sqrtl_pre 224022
Fl_sqrtl_raw 226866
Fl_sqrtn 232513
Fl_sqrtn_pre 232513
ZM_nv_mod_tree 236727
ZM_nv_mod_tree_t 242184
_Fp_equal0 260724
Z_chinese_all 267620
Z_chinese_pre 271337
Fl_powers 296050
Z_factor_listP 350651
pgener_Fp_local 358159
nxV_chinese_center 419404
nmV_chinese_center 420792
nmV_polint_center_tree 420792
polint_chinese 420882
u_odd_prime_divisors 464094
u_remove2 464094
mpfact 496546
u_is_gener_expo 531375
Fl_order 542740
Z_chinese_coprime 543975
pgener_Fl 575183
_Fp_rmul 575346
istotient_i 621565
init_montdata 660667
nxV_polint_center_tree 724542
_mul_remiibar 728704
Fp_select_red 867219
_Fp_red 889913
ZV_allpnqn 894782
nmV_polint_center_tree_worker 990122
gc_chinese 1012846
pgener_Fl_local 1051170
_Fp_neg 1086846
_Fp_add 1175565
to_ZX 1191516
bestappr_real 1245686
ZV_nv_mod_tree 1273581
Fp_pows 1346302
ncV_polint_center_tree 1525792
u_chinese_coprime 1589941
u_chinese_post 1589946
_mul_remii 1613434
is_gener_Fl 1628682
Fp_powu 1749351
_mul2_remiibar 1835592
chinese1_coprime_Z_aux 2191779
bestappr_Q 2241880
checkp 2289668
ZX_nv_mod_tree 2401126
chinese1_coprime_Z 2413435
gen_chinese 2415850
ZV_chinesetree 2595992
ZV_sqr 2596005
ZV_invdivexact 2596006
ZV_producttree 2599874
Z_chinese_post 3007350
icopy_lg 3136994
Qsfcont 3137344
gboundcf 3142307
_mul2_remii 3712148
Fp_log 3926367
Fl_2powu 4287866
Fp_log_use_index 4664028
Fp_sqrt 4832609
Fp_sqrt_i 4886407
gome 5608845
Fp_invgen 5908968
_mul_montred 6607072
_sqr_remiibar 7717097
_Fp_sqr 8134253
Fp_rem_mBarrett 8445801
Fp_easylog 8464622
_mul2_montred 9446987
nonsquare1_Fl 11628440
kronecker 11958180
Fl_sqrt 12302502
Fl_2powu_pre 12371906
Fl_sqrt_i 12423358
Fl_powers_pre 12809630
ZT_sqr 13423029
_Fp_mul 14129880
Fl_sqrt_pre 21131316
_sqr_remii 24509925
kroiu 27614438
_Fp_pow 27870678
Fl_sqrt_pre_i 33624385
Fp_pow 36206344
ZV_chinese_tree 39647736
lcmii 53348092
Z_ZV_mod_tree 57141220
_sqr_montred 62951762
kross 97360213
krouu 98619084
Fl_powu 139799892
Fl_powu_pre 151427088
krouu_s 227608118
ome 320725281

Generated by: LCOV version 1.16