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 - base3.c (source / functions) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31057-89c4d54ba6) Lines: 95.0 % 2159 2051
Test Date: 2026-07-25 17:02:42 Functions: 95.4 % 237 226
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
Ideallist 11333
Idealstar 938
Idealstarmod 270865
Idealstarmod_i 271138
Idealstarprk 273
Q_mod_bid 14
RgC_to_nfC 112896
RgM_RgX_mul 1365
RgM_to_nfM 6800
RgX_to_nfX 33747
ZC_add1 204736
ZC_cxlog 1768969
ZC_nfval 20262476
ZC_nfvalrem 24764776
ZC_prdvd 1294545
ZC_sub1 71778
ZMV_ZCV_mul 1919927
ZM_ZMV_mul 518
ZM_ZX_mul 10293174
ZV_snf_gcd 2321772
_mul 398462
_mulii 1146383652
_nf_add 3861892
_nf_inv 13727
_nf_mul 4502050
_nf_neg 204392
_nf_red 778543
_nf_s 3353
_sqr 1061132
algtobasis 975436
apply_U 2782031
basistoalg 226047
bid_grp 271453
check_mod_factored 271789
checkarchp 134113
chineseinit_i 6687
chk_ind 37121
concat_join 759815
cxlog_1 23453
cxlog_m1 541
ei_multable 40121
eltmul 350689
eltpow 499691
famatQ_to_famatZ 35
famat_abs 35
famat_cba 35
famat_cxlog 227519
famat_logembed 1309
famat_nfvalrem 422947
famat_norm 35
famat_sign 35
famat_strip2 271789
famat_to_nf_modideal_coprime 2927962
famat_zlog 1424663
famat_zlog_pr 2143570
famat_zlog_pr_coprime 196
get_C 730474
get_nf_field 54830
get_tab 40379502
gideallist 63
gpnfvalrem 15015
idealHNF_norm_pval 63
idealchinese 12779
idealfactorback 94612
ideallist 10563
ideallist0 11298
ideallistarch 14
ideallog 13769
ideallog_i 1521361
ideallog_units 84
ideallog_units0 239967
ideallogmod 1528039
idealprincipalunits 196
idealprincipalunits_i 194103
idealstar0 0
idealstarmod 112
idmul 72020
idmulred 56
idpow 87971
idpowred 413
indices_to_vec01 143710
init_zlog 395976
init_zlog_mod 2157304
is_chineseinit 13274
is_famat 54069179
isprfact 6218
join_arch 42
join_archunit 14
join_bid 469
join_bid_arch 42
join_ideal 268702
join_idealinit 469
join_unit 448
log_gen_arch 111993
log_gen_pr 484309
log_prk 3124564
log_prk1 1686218
log_prk_init 95417
log_prk_units 518
log_prk_units_init 49
low_prec 4744907
matalgtobasis 33258
matbasistoalg 3220
mulbytab 7300
multable 2058
nfC_multable_mul 31375
nfC_nf_mul 114287
nfM_det 14
nfM_inv 3339
nfM_ker 0
nfM_mul 2948
nfM_nfC_mul 48529
nfV_cxlog 97
nf_cxlog 1363184
nf_to_scalar_or_alg 7169615
nf_to_scalar_or_basis 123908954
nf_to_scalar_or_polmod 2134874
nfadd 14282389
nfarchstar 659006
nfchecksigns 14506
nfchecksigns_i 105795
nfdiv 40154
nfdiveuc 259
nfdivrem 259
nfeltembed 735
nfeltembed_i 735
nfeltsign 126175
nfembed 0
nfembed_i 2147
nffactorback 281078
nfinv 188896
nfinvmodideal 175
nfispower 11699
nfissquare 2163
nflogembed 107646
nfmod 259
nfmul 24580683
nfmuli 4817528
nfmuli_ZC 8246659
nfmulmodideal 7852832
nfmulpowmodideal 5090334
nfnorm 216442
nfpolsturm 2163
nfpow 1025274
nfpow_u 370603
nfpowmodideal 6491218
nfsetsigns 864254
nfsign 53914
nfsign_arch 1271060
nfsqr 6108632
nfsqri 4705620
nfsqri_ZC 7349688
nfsqrmodideal 2813765
nfsub 1432749
nftrace 22505
nfval 5614624
nfvalrem 3666401
num_positive 1164057
oksigns 34236
order_update 739870
parse_embed 129066
pl_convert 1220
pl_normalize 2996
pol_to_scalar_or_basis 3480211
polmod_nffix 181329
polmod_nffix2 181420
poltobasis 9654035
powp 973434
pr_basis_perm 72247
pr_equal 357
pr_init 6218
principal_units 194103
principal_units_relations 69958
rnfalgtobasis 1428
rnfbasistoalg 61264
rnfeltnorm 462
rnfelttrace 1050
sarch_get_F 730474
sarch_get_MI 730474
sarch_get_archp 1863727
sarch_get_cyc 512197
sarch_get_lambda 730474
scalar_logembed 15820
set_sign_mod_divisor 894898
setsigns_init 480676
split_U 270396
sprk_get_AgL2 0
sprk_get_L2 1552329
sprk_get_U2 1532197
sprk_get_cyc 4571337
sprk_get_expo 2143766
sprk_get_ff 3041957
sprk_get_gen 370391
sprk_get_gnf 318214
sprk_get_k 63
sprk_get_pr 2820337
sprk_get_prk 5630818
sprk_is_prime 3042020
sprk_log_gen_pr 2037
sprk_log_gen_pr2 145845
sprk_log_prk1 275877
sprk_log_prk1_2 444871
sprk_to_bid 63
sprkinit 465745
tablemul 0
tablemul_ei 4158
tablemul_ei_ej 5834
tablemulvec 2058
tablesqr 10356
to_RgX 119
vec01_to_indices 1330882
veclog_prk 497
vecsmall01_to_indices 2996
zidealij 275331
zidealstar 0
zidealstarinit 0
zidealstarinitgen 0
zkC_multable_mul 194459
zkVchinese1 270599
zk_ei_mul 24733042
zk_embed 104395
zk_inv 309319
zk_modHNF 8143217
zk_multable 11381024
zk_scalar_or_multable 5359154
zkadd 0
zkadd1 301882
zkchinese 0
zkchinese1 301882
zkchinese1init2 259
zkchineseinit 270340
zkmul 301882
zkmultable_capZ 1330602
zkmultable_inv 1639921
zksub 0
zksub1 301882
zlog 495257

Generated by: LCOV version 2.0-1