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 - base2.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30622-caa25a75db) Lines: 2227 2369 94.0 %
Date: 2026-01-22 09:18:00 Functions: 174 178 97.8 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Decomp 225486
Flx_checkdeflate 1408566
Flx_radical 1408563
FpX_radical 5609
Fp_basis 285524
FqM_to_nfM 2912
FqV_to_nfV 0
FqX_non_root 21
FqX_to_nfX 10188
Fq_to_nf 3075532
QXQV_to_FpM 199
QpXV_denom 450370
QpX_denom 2457649
QpX_remove_denom 1543959
RgV_nffix 49
RgX_nffix 320335
RgX_to_algX 1638
Rg_nffix 927091
ZX_Dedekind 1352296
ZX_rescale_inv 52065
Z_fac 197
Zlx_gcd 217055
Zlx_sylvester_echelon 4501462
ZpM_hnfmodid 400697
ZpX_disc_val 166445
ZpX_gcd 225486
ZpX_monic_factor 546
ZpX_monic_factor_squarefree 1155
ZpX_primedec 0
ZpX_reduced_resultant 880594
ZpX_reduced_resultant_fast 822337
ZpX_resultant_val 3423635
ZpX_resultant_val_i 3469049
ZpX_round4 896
ZpX_sylvester_echelon 73687
_msqr 4158
_sqr 15838
checkmodpr 210
checkprid 18012355
checkprid_i 23096963
compmod 253954
compositum 87
compositum2 2618
compositum_fix 23542
dbasis 546021
diag_denom 92507
diag_denomval 596677
ei_msqr_mod 332073
errprime 0
expo_is_squarefree 889
fact_from_factors 3977
ffdegree 3672
fill 4200
fix_PE 508
fnz 208778
gc_nf_to_Fq 14110426
gen_if_principal 35
get_LV 194003
get_coprimes 290
get_d 3214
get_g 317512
get_gamma 271745
get_maxord 704516
get_modpr 137753
get_module 63
get_norm 455196
get_nu 568209
get_partial_order_as_pols 450370
get_powers 145632
get_pr 377654
get_prid 939477
getprime 499104
hnf_Znproj 1039751
ideal_is1 7950
idealprimedec 1273664
idealprimedec_degrees 371
idealprimedec_galois 6518
idealprimedec_kummer 3813214
idealprimedec_limit_f 2726572
idealprimedec_limit_norm 499495
indexpartial 38704
init_m 4245970
init_norm 193999
is_uniformizer 455196
lift_to_zk 82697
loop 211402
manage_cache 627412
maxord 1352295
maxord_disc 610891
maxord_i 401591
minval 3725
mk_pr 4227298
modpr_TAU 3911804
modpr_genFq 4508
modprinit 1158872
mul_intersect 653471
mycaract 627419
newtoncharpoly 621198
newtonsums 627418
nfM_to_FqM 1861
nfV_to_FqV 167410
nfXQ_mul 16127
nfX_mul 20255
nfX_rem 16127
nfX_sub 4128
nfX_to_FqX 9375
nfX_to_monic 1652
nfXisintegral 7307
nf_pV_to_prV 37939
nf_pV_to_prVV 26521
nf_to_Fq 12860029
nf_to_Fq_i 14110944
nf_to_Fq_init 3910621
nfbasis 844
nfcompositum 11881
nfcompositum_lambda 511
nfdisc 58205
nfdiscfactors 552693
nfidealdet1 63
nfisintegral 32120
nfmaxord 93623
nfmaxord_check_args 704523
nfmodpr 350
nfmodprinit 7
nfmodprinit0 77
nfmodprlift 77
nfpolisintegral 8203
nfpolisintegral_i 8203
nfreducemodpr 210
ok_modpr 4775593
p_is_prime 2095
pol_min 108140
polcompositum0 11328
poldiscfactors 42
poldiscfactors_i 681948
pow_ei_mod_p 679048
pr_anti_uniformizer 955354
pr_factorback 4277
pr_factorback_scal 4277
pradical 194002
primedec_aux 2733458
primedec_end 194003
progress 347956
redelt 42552
redelt_i 57080
rnfallbase 3165
rnfbasis 21
rnfdedekind 91
rnfdedekind_i 4156
rnfdet 14
rnfdisc_factored 854
rnfdiscf 77
rnfeltid_powmod 5746
rnfhnfbasis 7
rnfisfree 7
rnfjoinmodules 1329
rnfjoinmodules_i 2100
rnfmaxord 4072
rnfsimplifybasis 0
rnfsteinitz 28
safe_Z_pvalrem 14159
setPE 646307
set_disc 704512
split_char 428086
sqr_mod 771719
testb2 60340
testc2 42552
to_ff_init 3942776
triv_order 1513
uniformizer 271076
update_den 3211180
update_fact 2276
update_phi 243015
vstar 551872
zk_to_Fq 6475757
zk_to_Fq_init 32155
zkmodprinit 174095
zx_z_div 1346679

Generated by: LCOV version 1.16