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 30582-6e9af8ee1d) Lines: 2080 2301 90.4 %
Date: 2025-12-20 09:23:49 Functions: 218 233 93.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
ECP_psi 837
Fl_2gener_pre 196634
Fl_2gener_pre_i 65765
Fl_2powu 4375419
Fl_2powu_pre 12983246
Fl_lgener_pre_all 149519
Fl_log 132488
Fl_log_Fp 0
Fl_log_naive 132488
Fl_log_naive_pre 29717
Fl_log_pre 30115
Fl_order 546562
Fl_powers 296064
Fl_powers_pre 13287430
Fl_powu 141494290
Fl_powu_pre 166497824
Fl_sqrt 12507390
Fl_sqrt_i 12628901
Fl_sqrt_pre 23504271
Fl_sqrt_pre_i 36205759
Fl_sqrtl 0
Fl_sqrtl_pre 235114
Fl_sqrtl_raw 238074
Fl_sqrtn 233408
Fl_sqrtn_pre 233409
FpV_prod 497
Fp_2gener 3299
Fp_2gener_all 5916
Fp_2gener_i 19392
Fp_easylog 8819495
Fp_factored_order 70
Fp_gausssum 371
Fp_invgen 6094539
Fp_invmBarrett 15502
Fp_log 4259603
Fp_log_find_ind 126
Fp_log_find_rel 126
Fp_log_halfgcd 56784
Fp_log_index 63
Fp_log_sieve 63
Fp_log_sieve_worker 30252
Fp_log_use_index 5039792
Fp_order 136596
Fp_pow 37763255
Fp_pow_init 105
Fp_pow_table 43694
Fp_powers 5931
Fp_pows 1346203
Fp_powu 1755466
Fp_rem_mBarrett 9738211
Fp_rootsof1 805
Fp_select_red 880259
Fp_sqrt 4844429
Fp_sqrt_i 4902890
Fp_sqrt_ii 80203
Fp_sqrtn 173555
Fp_sqrts 18729
Qsfcont 3137414
ZMV_producttree 0
ZM_nv_mod_tree 215475
ZM_nv_mod_tree_t 220932
ZT_sqr 13628991
ZVV_nv_mod_tree 5457
ZV_allpnqn 894831
ZV_chinese 5141
ZV_chinese_center 157359
ZV_chinese_tree 40745626
ZV_chinesetree 2632924
ZV_invdivexact 2632919
ZV_nv_mod_tree 1235332
ZV_producttree 2637665
ZV_sqr 2632918
ZXC_nv_mod_tree 5634
ZXM_nv_mod_tree 491
ZXX_nv_mod_tree 254897
ZX_nv_mod_tree 3104328
Z_ZV_mod 0
Z_ZV_mod_tree 58133301
Z_chinese 2142
Z_chinese_all 268103
Z_chinese_coprime 545412
Z_chinese_post 3071059
Z_chinese_pre 271826
Z_factor_listP 350651
Z_nv_mod 0
Zp_order 70
_Fp_add 1175565
_Fp_equal0 260724
_Fp_inv 34307
_Fp_mul 14228551
_Fp_neg 1086846
_Fp_one 47162
_Fp_pow 28603340
_Fp_rand 195
_Fp_red 889913
_Fp_rmul 575346
_Fp_s 19075
_Fp_sqr 8134253
_computeG 837
_gc_upto 112
_mul2_montred 10629360
_mul2_remii 4246875
_mul2_remiibar 2129440
_mul_montred 7111470
_mul_remii 1771253
_mul_remiibar 839340
_psi 1714
_sqr_montred 67964007
_sqr_remii 26363986
_sqr_remiibar 8898871
addifsmooth1 2163
addifsmooth2 83825
bestappr 105489
bestapprPade 119
bestapprPade0 126
bestappr_Q 2289928
bestappr_RgX 119
bestappr_frac 7
bestappr_real 1272941
bestappr_ser 98
check_kernel 63
checkp 2656753
chinese 5495
chinese1 2415
chinese1_coprime_Z 2460630
chinese1_coprime_Z_aux 2253539
compute_nbgen 63
contfrac0 49
contfracpnqn 266
err_oo 56
err_p 161
err_prec 196
factorial_Fl 56815
factorial_Fp 186
fibo 7
gboundcf 3142391
gc_chinese 981262
gc_empty 42
gcf 126
gcf2 0
gen_chinese 2463045
gener_Zp 259
get_Fp_field 6963
get_PHI 98
gome 5897681
hilbert 62314
hilbertii 140826
icopy_lg 3137064
init_montdata 667706
intmod2polmod 21
is_gener_Fl 1662321
is_gener_Fp 13965
is_gener_expo 4909
istotient 70000
istotient_i 621565
krois 40089
kroiu 27627725
kronecker 12750980
krosi 159682
kross 102527310
kroui 35758
krouodd 195440
krouu 102882445
krouu_s 237855168
lcmii 54541763
lift_intmod 420
lift_padic 210
lucas 56
mod_to_frac 42
mod_to_rfrac 112
mpfact 498580
mphilbertoo 7329
mpprimorial 105
muls_interval 595
mulu_interval 159074
mulu_interval_step 92761
ncV_chinese_center 10585
ncV_chinese_center_tree 5457
ncV_polint_center_tree 1515766
nmV_chinese_center 378612
nmV_chinese_center_tree 0
nmV_chinese_center_tree_seq 120507
nmV_polint_center_tree 378612
nmV_polint_center_tree_seq 120506
nmV_polint_center_tree_worker 975799
nonsquare1_Fl 12259911
nonsquare_Fl 7930
nonsquare_Fp 1497
nxCV_chinese_center 0
nxCV_chinese_center_tree 0
nxCV_polint_center_tree 6585
nxMV_chinese_center 104
nxMV_chinese_center_tree_seq 491
nxMV_polint_center_tree 104
nxMV_polint_center_tree_seq 491
nxMV_polint_center_tree_worker 1225
nxV_chinese_center 429461
nxV_chinese_center_tree 304302
nxV_polint_center_tree 876112
odd_prime_divisors 1812
ome 335815000
opt_param 63
padic2mod 21
pgener_Fl 574909
pgener_Fl_local 1080977
pgener_Fp 44282
pgener_Fp_local 412299
pgener_Zl 205556
pgener_Zp 170800
pnqn 0
polint_chinese 378716
remove2 1812
rootsof1_Fl 215543
rootsof1_Fp 0
rootsof1u_Fp 3033
rt 169813
serPade 49
sersfcont 0
sfcont2 14
sqrt_Cipolla 0
sqrt_Cipolla_msqr 0
sqrt_Cipolla_sqr 0
to_ZX 1891410
tr 59731
u_chinese_coprime 1638923
u_chinese_post 1638931
u_is_gener_expo 544967
u_odd_prime_divisors 463946
u_remove2 463945
znlog 238
znlog_rec 126
znorder 63
znprimroot 329

Generated by: LCOV version 1.16