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 30625-1bbc371a2f) Lines: 2080 2301 90.4 %
Date: 2026-01-23 09:24:12 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 188819
Fl_2gener_pre_i 65849
Fl_2powu 4358729
Fl_2powu_pre 12899696
Fl_lgener_pre_all 146939
Fl_log 132362
Fl_log_Fp 0
Fl_log_naive 132362
Fl_log_naive_pre 28893
Fl_log_pre 29291
Fl_order 546541
Fl_powers 296050
Fl_powers_pre 13077172
Fl_powu 141864660
Fl_powu_pre 166173321
Fl_sqrt 12404813
Fl_sqrt_i 12526435
Fl_sqrt_pre 23398164
Fl_sqrt_pre_i 35993249
Fl_sqrtl 0
Fl_sqrtl_pre 229892
Fl_sqrtl_raw 232850
Fl_sqrtn 233411
Fl_sqrtn_pre 233411
FpV_prod 497
Fp_2gener 3222
Fp_2gener_all 5909
Fp_2gener_i 19392
Fp_easylog 8819470
Fp_factored_order 70
Fp_gausssum 351
Fp_invgen 6096373
Fp_invmBarrett 14036
Fp_log 4259578
Fp_log_find_ind 126
Fp_log_find_rel 126
Fp_log_halfgcd 56570
Fp_log_index 63
Fp_log_sieve 63
Fp_log_sieve_worker 30235
Fp_log_use_index 5039790
Fp_order 136407
Fp_pow 37753136
Fp_pow_init 105
Fp_pow_table 43694
Fp_powers 5931
Fp_pows 1346197
Fp_powu 1754385
Fp_rem_mBarrett 8296561
Fp_rootsof1 820
Fp_select_red 869465
Fp_sqrt 4844815
Fp_sqrt_i 4898490
Fp_sqrt_ii 75169
Fp_sqrtn 173541
Fp_sqrts 18948
Qsfcont 3137414
ZMV_producttree 0
ZM_nv_mod_tree 215592
ZM_nv_mod_tree_t 221049
ZT_sqr 13612515
ZVV_nv_mod_tree 5457
ZV_allpnqn 894831
ZV_chinese 5141
ZV_chinese_center 157111
ZV_chinese_tree 40853380
ZV_chinesetree 2631093
ZV_invdivexact 2631087
ZV_nv_mod_tree 1235068
ZV_producttree 2634912
ZV_sqr 2631129
ZXC_nv_mod_tree 5634
ZXM_nv_mod_tree 491
ZXX_nv_mod_tree 254437
ZX_nv_mod_tree 3096091
Z_ZV_mod 0
Z_ZV_mod_tree 58146002
Z_chinese 2142
Z_chinese_all 268105
Z_chinese_coprime 547188
Z_chinese_post 3072747
Z_chinese_pre 271829
Z_factor_listP 350651
Z_nv_mod 0
Zp_order 70
_Fp_add 1175498
_Fp_equal0 260711
_Fp_inv 34301
_Fp_mul 14228572
_Fp_neg 1086813
_Fp_one 47162
_Fp_pow 28603309
_Fp_rand 160
_Fp_red 889818
_Fp_rmul 575252
_Fp_s 19073
_Fp_sqr 8134253
_computeG 837
_gc_upto 112
_mul2_montred 9358552
_mul2_remii 3596849
_mul2_remiibar 1797854
_mul_montred 6663666
_mul_remii 1482225
_mul_remiibar 717268
_psi 1714
_sqr_montred 63081357
_sqr_remii 23729536
_sqr_remiibar 7579293
addifsmooth1 2163
addifsmooth2 83825
bestappr 105645
bestapprPade 119
bestapprPade0 126
bestappr_Q 2294390
bestappr_RgX 119
bestappr_frac 7
bestappr_real 1273915
bestappr_ser 98
check_kernel 63
checkp 2580682
chinese 5495
chinese1 2415
chinese1_coprime_Z 2460672
chinese1_coprime_Z_aux 2253538
compute_nbgen 63
contfrac0 49
contfracpnqn 266
err_oo 56
err_p 161
err_prec 196
factorial_Fl 56793
factorial_Fp 186
fibo 7
gboundcf 3142391
gc_chinese 980546
gc_empty 42
gcf 126
gcf2 0
gen_chinese 2463087
gener_Zp 259
get_Fp_field 6961
get_PHI 98
gome 5846431
hilbert 62314
hilbertii 140826
icopy_lg 3137064
init_montdata 661595
intmod2polmod 21
is_gener_Fl 1662307
is_gener_Fp 13973
is_gener_expo 4909
istotient 70000
istotient_i 621565
krois 40089
kroiu 27625466
kronecker 12750880
krosi 159682
kross 100335613
kroui 35700
krouodd 195382
krouu 102683471
krouu_s 235463599
lcmii 54524561
lift_intmod 420
lift_padic 210
lucas 56
mod_to_frac 42
mod_to_rfrac 112
mpfact 498565
mphilbertoo 7329
mpprimorial 105
muls_interval 595
mulu_interval 159080
mulu_interval_step 92847
ncV_chinese_center 10333
ncV_chinese_center_tree 5457
ncV_polint_center_tree 1512645
nmV_chinese_center 378539
nmV_chinese_center_tree 0
nmV_chinese_center_tree_seq 120529
nmV_polint_center_tree 378539
nmV_polint_center_tree_seq 120530
nmV_polint_center_tree_worker 973324
nonsquare1_Fl 12042113
nonsquare_Fl 7930
nonsquare_Fp 1458
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 429318
nxV_chinese_center_tree 303750
nxV_polint_center_tree 875601
odd_prime_divisors 1812
ome 334736937
opt_param 63
padic2mod 21
pgener_Fl 574875
pgener_Fl_local 1080946
pgener_Fp 44282
pgener_Fp_local 412330
pgener_Zl 205549
pgener_Zp 170793
pnqn 0
polint_chinese 378643
remove2 1812
rootsof1_Fl 215522
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 1885026
tr 59731
u_chinese_coprime 1639023
u_chinese_post 1639030
u_is_gener_expo 544961
u_odd_prime_divisors 463920
u_remove2 463920
znlog 238
znlog_rec 126
znorder 63
znprimroot 329

Generated by: LCOV version 1.16