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 30504-e6f76a2795) Lines: 2080 2301 90.4 %
Date: 2025-09-29 09:23:05 Functions: 218 233 93.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fl_log_Fp 0
Fl_sqrtl 0
ZMV_producttree 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
bestappr_ser 98
get_PHI 98
nxMV_chinese_center 104
nxMV_polint_center_tree 104
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
err_p 161
_Fp_rand 167
err_prec 196
lift_padic 210
znlog 238
gener_Zp 259
contfracpnqn 266
znprimroot 329
Fp_gausssum 363
factorial_Fp 382
lift_intmod 420
ZXM_nv_mod_tree 491
nxMV_chinese_center_tree_seq 491
nxMV_polint_center_tree_seq 491
FpV_prod 497
muls_interval 623
ECP_psi 837
_computeG 837
Fp_rootsof1 846
nxMV_polint_center_tree_worker 1225
nonsquare_Fp 1460
_psi 1714
odd_prime_divisors 1812
remove2 1812
Z_chinese 2142
addifsmooth1 2163
chinese1 2415
rootsof1u_Fp 3033
Fp_2gener 3327
is_gener_expo 4909
ZV_chinese 5141
ZVV_nv_mod_tree 5457
ncV_chinese_center_tree 5457
chinese 5495
ZXC_nv_mod_tree 5634
Fp_2gener_all 5916
Fp_powers 5931
nxCV_polint_center_tree 6585
get_Fp_field 6963
mphilbertoo 7329
nonsquare_Fl 7930
ncV_chinese_center 10565
is_gener_Fp 13982
Fp_invmBarrett 15403
Fp_sqrts 18505
_Fp_s 19075
Fp_2gener_i 19392
Fl_log_naive_pre 29056
Fl_log_pre 29454
Fp_log_sieve_worker 30239
_Fp_inv 34307
kroui 35344
krois 40089
Fp_pow_table 43694
pgener_Fp 44282
_Fp_one 47162
factorial_Fl 56858
Fp_log_halfgcd 56886
tr 59731
hilbert 62314
Fl_2gener_pre_i 65765
istotient 70000
Fp_sqrt_ii 80245
addifsmooth2 83825
mulu_interval_step 92783
bestappr 105403
nmV_chinese_center_tree_seq 120301
nmV_polint_center_tree_seq 120301
Fp_order 132354
Fl_log 132390
Fl_log_naive 132390
hilbertii 140826
Fl_lgener_pre_all 148214
ZV_chinese_center 157293
mulu_interval 159076
krosi 159626
rt 169813
pgener_Zp 170989
Fp_sqrtn 173548
Fl_2gener_pre 193776
krouodd 194970
pgener_Zl 205745
ZM_nv_mod_tree 214990
rootsof1_Fl 215543
ZM_nv_mod_tree_t 220447
Fl_sqrtn 232514
Fl_sqrtn_pre 232515
Fl_sqrtl_pre 233561
Fl_sqrtl_raw 236403
ZXX_nv_mod_tree 254886
_Fp_equal0 260724
Z_chinese_all 267623
Z_chinese_pre 271342
Fl_powers 296057
nxV_chinese_center_tree 304225
Z_factor_listP 350651
nmV_chinese_center 377887
nmV_polint_center_tree 377887
polint_chinese 377991
pgener_Fp_local 412299
nxV_chinese_center 429360
u_odd_prime_divisors 464143
u_remove2 464143
mpfact 497239
Fl_order 542782
Z_chinese_coprime 544091
u_is_gener_expo 545150
pgener_Fl 575260
_Fp_rmul 575346
istotient_i 621565
init_montdata 667806
_mul_remiibar 842605
nxV_polint_center_tree 876026
Fp_select_red 880805
_Fp_red 889913
ZV_allpnqn 894831
nmV_polint_center_tree_worker 974759
gc_chinese 980348
pgener_Fl_local 1081322
_Fp_neg 1086846
_Fp_add 1175565
ZV_nv_mod_tree 1234340
bestappr_real 1271057
Fp_pows 1346195
ncV_polint_center_tree 1514853
u_chinese_coprime 1636831
u_chinese_post 1636842
is_gener_Fl 1662688
Fp_powu 1755856
_mul_remii 1827721
to_ZX 1893738
_mul2_remiibar 2115746
chinese1_coprime_Z_aux 2253539
bestappr_Q 2285913
chinese1_coprime_Z 2460580
gen_chinese 2462995
checkp 2600267
ZV_chinesetree 2631557
ZV_sqr 2631563
ZV_invdivexact 2631565
ZV_producttree 2636234
Z_chinese_post 3069233
ZX_nv_mod_tree 3106409
icopy_lg 3137064
Qsfcont 3137414
gboundcf 3142391
Fp_log 4259278
_mul2_remii 4307987
Fl_2powu 4359102
Fp_sqrt 4845925
Fp_sqrt_i 4904406
Fp_log_use_index 5039419
gome 5891469
Fp_invgen 6089034
_mul_montred 7093935
_Fp_sqr 8134253
Fp_easylog 8819064
_sqr_remiibar 8893222
Fp_rem_mBarrett 9735827
_mul2_montred 10517878
nonsquare1_Fl 12207009
Fl_sqrt 12489629
Fl_sqrt_i 12610547
kronecker 12751279
Fl_2powu_pre 12942466
Fl_powers_pre 13113230
ZT_sqr 13619798
_Fp_mul 14228411
Fl_sqrt_pre 22636338
_sqr_remii 26697506
kroiu 27630905
_Fp_pow 28602557
Fl_sqrt_pre_i 35322950
Fp_pow 37760982
ZV_chinese_tree 40751712
lcmii 54529926
Z_ZV_mod_tree 58158826
_sqr_montred 67724621
krouu 101517089
kross 101947420
Fl_powu 141587859
Fl_powu_pre 165543181
krouu_s 235917403
ome 330875288

Generated by: LCOV version 1.16