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 30702-bddb8d6928) Lines: 2227 2369 94.0 %
Date: 2026-02-23 02:23:56 Functions: 174 178 97.8 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
FqV_to_nfV 0
ZpX_primedec 0
errprime 0
rnfsimplifybasis 0
nfmodprinit 6
rnfhnfbasis 6
rnfisfree 6
rnfdet 10
FqX_non_root 15
rnfbasis 16
rnfsteinitz 22
gen_if_principal 28
RgV_nffix 35
poldiscfactors 36
nfidealdet1 47
get_module 48
rnfdiscf 59
nfmodprinit0 66
nfmodprlift 66
rnfdedekind 66
compositum 74
QXQV_to_FpM 163
Z_fac 165
checkmodpr 180
nfreducemodpr 180
get_coprimes 231
nfmodpr 300
idealprimedec_degrees 318
fix_PE 412
nfcompositum_lambda 438
ZpX_monic_factor 451
expo_is_squarefree 717
rnfdisc_factored 722
ZpX_round4 736
nfbasis 797
ZpX_monic_factor_squarefree 934
rnfjoinmodules 1068
triv_order 1279
RgX_to_algX 1390
nfX_to_monic 1400
nfM_to_FqM 1510
rnfjoinmodules_i 1682
p_is_prime 1718
update_fact 1955
FqM_to_nfM 2358
compositum2 2431
rnfallbase 2667
get_d 2706
minval 3033
rnfmaxord 3356
fill 3364
nfX_sub 3396
_msqr 3404
rnfdedekind_i 3417
ffdegree 3516
fact_from_factors 3579
pr_factorback 3592
pr_factorback_scal 3592
modpr_genFq 3864
FpX_radical 4474
rnfeltid_powmod 4669
idealprimedec_galois 5581
nfXisintegral 6073
ideal_is1 6443
nfpolisintegral 6667
nfpolisintegral_i 6667
nfX_to_FqX 7692
FqX_to_nfX 8346
polcompositum0 10991
nfcompositum 11465
safe_Z_pvalrem 12675
_sqr 12908
nfXQ_mul 13236
nfX_rem 13236
nfX_mul 16632
compositum_fix 22742
nf_pV_to_prVV 22785
nfisintegral 26375
zk_to_Fq_init 29150
nf_pV_to_prV 33057
indexpartial 37674
redelt 41436
testc2 41436
ZX_rescale_inv 51194
redelt_i 54426
testb2 56467
nfdisc 56487
ZpX_sylvester_echelon 70236
lift_to_zk 80233
diag_denom 85081
nfmaxord 86833
pol_min 101220
get_modpr 118074
get_powers 137737
nfV_to_FqV 143400
zkmodprinit 149783
ZpX_disc_val 154092
get_LV 185322
init_norm 185322
pradical 185322
primedec_end 185322
fnz 185782
loop 201896
Zlx_gcd 207708
Decomp 214873
ZpX_gcd 214873
update_phi 234910
compmod 243332
get_gamma 254557
uniformizer 255677
Fp_basis 265395
RgX_nffix 280198
ei_msqr_mod 297926
get_g 299990
progress 334673
get_pr 354841
ZpM_hnfmodid 384403
maxord_i 385139
split_char 404474
idealprimedec_limit_norm 415074
QpXV_denom 429268
get_partial_order_as_pols 429268
get_norm 431517
is_uniformizer 431517
getprime 476463
dbasis 525571
vstar 528234
get_nu 541481
nfdiscfactors 552684
diag_denomval 587202
newtoncharpoly 590108
manage_cache 595787
mycaract 595787
newtonsums 595787
mul_intersect 604985
maxord_disc 609165
pow_ei_mod_p 637255
setPE 639512
poldiscfactors_i 675857
get_maxord 695998
nfmaxord_check_args 695998
set_disc 695998
sqr_mod 704133
ZpX_reduced_resultant_fast 790113
get_prid 805278
Rg_nffix 818264
ZpX_reduced_resultant 838873
pr_anti_uniformizer 861407
hnf_Znproj 927793
modprinit 1037988
idealprimedec 1109738
zx_z_div 1299747
ZX_Dedekind 1304221
maxord 1304221
Flx_checkdeflate 1357355
Flx_radical 1357355
QpX_remove_denom 1473628
QpX_denom 2308147
idealprimedec_limit_f 2391255
primedec_aux 2397154
Fq_to_nf 2641913
update_den 2981013
ZpX_resultant_val 3026306
ZpX_resultant_val_i 3061978
idealprimedec_kummer 3338260
nf_to_Fq_init 3443041
modpr_TAU 3443994
to_ff_init 3472191
mk_pr 3731261
init_m 3816419
Zlx_sylvester_echelon 4045488
ok_modpr 4186047
zk_to_Fq 5568322
nf_to_Fq 11054948
gc_nf_to_Fq 12112653
nf_to_Fq_i 12113085
checkprid 15601850
checkprid_i 20065907

Generated by: LCOV version 1.16