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) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30565-738e569de9) Lines: 2050 2158 95.0 %
Date: 2025-11-30 09:23:42 Functions: 226 237 95.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Ideallist 11332
Idealstar 938
Idealstarmod 270836
Idealstarmod_i 271112
Idealstarprk 273
Q_mod_bid 14
RgC_to_nfC 112896
RgM_RgX_mul 1365
RgM_to_nfM 6800
RgX_to_nfX 32873
ZC_add1 204715
ZC_cxlog 1765411
ZC_nfval 19831367
ZC_nfvalrem 24329684
ZC_prdvd 1290490
ZC_sub1 71777
ZMV_ZCV_mul 1919858
ZM_ZMV_mul 518
ZM_ZX_mul 10263141
ZV_snf_gcd 2321394
_mul 395707
_mulii 1091557387
_nf_add 3861892
_nf_inv 13727
_nf_mul 4502050
_nf_neg 204392
_nf_red 778543
_nf_s 3353
_sqr 1055745
algtobasis 971935
apply_U 2781865
basistoalg 226257
bid_grp 271399
check_mod_factored 271755
checkarchp 134103
chineseinit_i 6687
chk_ind 37121
concat_join 758189
cxlog_1 23198
cxlog_m1 534
ei_multable 40295
eltmul 349161
eltpow 498282
famatQ_to_famatZ 35
famat_abs 35
famat_cba 35
famat_cxlog 225446
famat_logembed 1309
famat_nfvalrem 422947
famat_norm 35
famat_sign 35
famat_strip2 271748
famat_to_nf_modideal_coprime 2927783
famat_zlog 1424660
famat_zlog_pr 2143554
famat_zlog_pr_coprime 196
get_C 730076
get_nf_field 54830
get_tab 40310575
gideallist 63
gpnfvalrem 15015
idealHNF_norm_pval 63
idealchinese 12779
idealfactorback 94601
ideallist 10563
ideallist0 11297
ideallistarch 14
ideallog 13769
ideallog_i 1521358
ideallog_units 84
ideallog_units0 239955
ideallogmod 1528040
idealprincipalunits 196
idealprincipalunits_i 194101
idealstar0 0
idealstarmod 112
idmul 72020
idmulred 56
idpow 87971
idpowred 413
indices_to_vec01 143702
init_zlog 395952
init_zlog_mod 2157253
is_chineseinit 13274
is_famat 54062279
isprfact 6218
join_arch 42
join_archunit 14
join_bid 469
join_bid_arch 42
join_ideal 268460
join_idealinit 469
join_unit 448
log_gen_arch 111984
log_gen_pr 484267
log_prk 3124403
log_prk1 1686118
log_prk_init 95423
log_prk_units 518
log_prk_units_init 49
low_prec 4737282
matalgtobasis 33209
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 1359934
nf_to_scalar_or_alg 7165616
nf_to_scalar_or_basis 123850686
nf_to_scalar_or_polmod 2133817
nfadd 14282340
nfarchstar 658700
nfchecksigns 14506
nfchecksigns_i 105794
nfdiv 40276
nfdiveuc 259
nfdivrem 259
nfeltembed 735
nfeltembed_i 735
nfeltsign 126175
nfembed 0
nfembed_i 2147
nffactorback 279393
nfinv 188805
nfinvmodideal 175
nfispower 11705
nfissquare 1218
nflogembed 107645
nfmod 259
nfmul 24579122
nfmuli 4804999
nfmuli_ZC 8239528
nfmulmodideal 7844268
nfmulpowmodideal 5082756
nfnorm 220858
nfpolsturm 2163
nfpow 1021669
nfpow_u 370808
nfpowmodideal 6482638
nfsetsigns 863981
nfsign 53914
nfsign_arch 1268097
nfsqr 6108346
nfsqri 4698409
nfsqri_ZC 7342141
nfsqrmodideal 2812177
nfsub 1432749
nftrace 21305
nfval 5610237
nfvalrem 3667156
num_positive 1163277
oksigns 34197
order_update 739837
parse_embed 129066
pl_convert 1220
pl_normalize 2996
pol_to_scalar_or_basis 3474321
polmod_nffix 181329
polmod_nffix2 181420
poltobasis 9638729
powp 973413
pr_basis_perm 72247
pr_equal 357
pr_init 6218
principal_units 194097
principal_units_relations 69965
rnfalgtobasis 1428
rnfbasistoalg 61264
rnfeltnorm 462
rnfelttrace 1050
sarch_get_F 730074
sarch_get_MI 730075
sarch_get_archp 1863179
sarch_get_cyc 512152
sarch_get_lambda 730076
scalar_logembed 15820
set_sign_mod_divisor 894627
setsigns_init 480423
split_U 270381
sprk_get_AgL2 0
sprk_get_L2 1552204
sprk_get_U2 1532079
sprk_get_cyc 4570930
sprk_get_expo 2143751
sprk_get_ff 3041818
sprk_get_gen 370352
sprk_get_gnf 318207
sprk_get_k 63
sprk_get_pr 2820277
sprk_get_prk 5630453
sprk_is_prime 3041824
sprk_log_gen_pr 2037
sprk_log_gen_pr2 145833
sprk_log_prk1 275856
sprk_log_prk1_2 444823
sprk_to_bid 63
sprkinit 465680
tablemul 0
tablemul_ei 4158
tablemul_ei_ej 5834
tablemulvec 2058
tablesqr 10356
to_RgX 119
vec01_to_indices 1327913
veclog_prk 497
vecsmall01_to_indices 2996
zidealij 275336
zidealstar 0
zidealstarinit 0
zidealstarinitgen 0
zkC_multable_mul 194463
zkVchinese1 270558
zk_ei_mul 24681718
zk_embed 104180
zk_inv 309423
zk_modHNF 8133103
zk_multable 11363723
zk_scalar_or_multable 5350555
zkadd 0
zkadd1 301789
zkchinese 0
zkchinese1 301841
zkchinese1init2 259
zkchineseinit 270312
zkmul 301797
zkmultable_capZ 1328601
zkmultable_inv 1638022
zksub 0
zksub1 301842
zlog 495229

Generated by: LCOV version 1.16