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 30764-6b81f1f3fa) Lines: 2227 2369 94.0 %
Date: 2026-03-25 09:26:52 Functions: 174 178 97.8 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Decomp 254737
Flx_checkdeflate 1602354
Flx_radical 1602351
FpX_radical 5693
Fp_basis 312085
FqM_to_nfM 2934
FqV_to_nfV 0
FqX_non_root 21
FqX_to_nfX 10226
Fq_to_nf 3087512
QXQV_to_FpM 203
QpXV_denom 508876
QpX_denom 2749807
QpX_remove_denom 1743032
RgV_nffix 49
RgX_nffix 327963
RgX_to_algX 1666
Rg_nffix 960565
ZX_Dedekind 1539625
ZX_rescale_inv 59975
Z_fac 197
Zlx_gcd 246231
Zlx_sylvester_echelon 4802598
ZpM_hnfmodid 454072
ZpX_disc_val 184521
ZpX_gcd 254739
ZpX_monic_factor 546
ZpX_monic_factor_squarefree 1155
ZpX_primedec 0
ZpX_reduced_resultant 993209
ZpX_reduced_resultant_fast 932082
ZpX_resultant_val 3582648
ZpX_resultant_val_i 3628790
ZpX_round4 896
ZpX_sylvester_echelon 74166
_msqr 4158
_sqr 16190
checkmodpr 210
checkprid 18387950
checkprid_i 23627007
compmod 287189
compositum 91
compositum2 2870
compositum_fix 26675
dbasis 620933
diag_denom 100208
diag_denomval 686757
ei_msqr_mod 352887
errprime 0
expo_is_squarefree 889
fact_from_factors 4235
ffdegree 4109
fill 4222
fix_PE 512
fnz 222732
gc_nf_to_Fq 14188646
gen_if_principal 35
get_LV 216874
get_coprimes 294
get_d 3220
get_g 356424
get_gamma 303311
get_maxord 815696
get_modpr 137753
get_module 63
get_norm 505929
get_nu 641240
get_partial_order_as_pols 508881
get_powers 161543
get_pr 416577
get_prid 939974
getprime 563555
hnf_Znproj 1083969
ideal_is1 8049
idealprimedec 1299797
idealprimedec_degrees 371
idealprimedec_galois 6601
idealprimedec_kummer 3936450
idealprimedec_limit_f 2822590
idealprimedec_limit_norm 507445
indexpartial 44108
init_m 4514687
init_norm 216857
is_uniformizer 505928
lift_to_zk 93673
loop 238638
manage_cache 706104
maxord 1539628
maxord_disc 713672
maxord_i 454966
minval 3776
mk_pr 4397022
modpr_TAU 4050471
modpr_genFq 4508
modprinit 1212552
mul_intersect 712131
mycaract 706139
newtoncharpoly 699338
newtonsums 706145
nfM_to_FqM 1872
nfV_to_FqV 167410
nfXQ_mul 16523
nfX_mul 20667
nfX_rem 16523
nfX_sub 4144
nfX_to_FqX 9415
nfX_to_monic 1680
nfXisintegral 7329
nf_pV_to_prV 38605
nf_pV_to_prVV 26614
nf_to_Fq 12922022
nf_to_Fq_i 14189166
nf_to_Fq_init 4049272
nfbasis 938
nfcompositum 13452
nfcompositum_lambda 511
nfdisc 68898
nfdiscfactors 644785
nfidealdet1 63
nfisintegral 32235
nfmaxord 102025
nfmaxord_check_args 815705
nfmodpr 350
nfmodprinit 7
nfmodprinit0 77
nfmodprlift 77
nfpolisintegral 8253
nfpolisintegral_i 8253
nfreducemodpr 210
ok_modpr 4916699
p_is_prime 2206
pol_min 118920
polcompositum0 12899
poldiscfactors 42
poldiscfactors_i 791284
pow_ei_mod_p 748342
pr_anti_uniformizer 1005838
pr_factorback 4277
pr_factorback_scal 4277
pradical 216873
primedec_aux 2829557
primedec_end 216874
progress 394438
redelt 48553
redelt_i 64355
rnfallbase 3171
rnfbasis 21
rnfdedekind 91
rnfdedekind_i 4172
rnfdet 14
rnfdisc_factored 868
rnfdiscf 77
rnfeltid_powmod 5834
rnfhnfbasis 7
rnfisfree 7
rnfjoinmodules 1329
rnfjoinmodules_i 2111
rnfmaxord 4088
rnfsimplifybasis 0
rnfsteinitz 28
safe_Z_pvalrem 15029
setPE 746790
set_disc 815662
split_char 480400
sqr_mod 830975
testb2 67195
testc2 48553
to_ff_init 4083392
triv_order 1513
uniformizer 299969
update_den 3570166
update_fact 2357
update_phi 276587
vstar 624264
zk_to_Fq 6521080
zk_to_Fq_init 34111
zkmodprinit 175369
zx_z_div 1533909

Generated by: LCOV version 1.16