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 - base4.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30605-980f9eb85c) Lines: 1696 1847 91.8 %
Date: 2026-01-11 09:21:30 Functions: 170 185 91.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fl_invgen 5900621
Q_nffactor 28500
Q_to_famat 197084
RM_round_maxrank 97992
ZM_famat_limit 568153
ZV_cba 28
ZV_cba_extend 49
Z_cba 757267
Z_cba_rec 6827597
Z_dcba_rec 0
Z_ppgle 0
Z_ppio 986062
Z_ppo 19279219
Z_to_famat 376307
_idealaddtoone 803204
_idealmulred 28606
_idealsqrred 35754
_mul 11385
_sqr 35754
addmul_mat 66597
append 154123
chk_vdir 21
err_divexact 7
ext_inv 20408
ext_mul 60620
ext_pow 0
ext_sqr 33941
factorbackprime 75591
famatV_factorback 13814
famatV_zv_factorback 56273
famat_Z_gcd 0
famat_add 160836
famat_div 200129
famat_div_shallow 10311
famat_idealfactor 0
famat_inv 199378
famat_inv_shallow 26953
famat_makecoprime 2220939
famat_mul 449638
famat_mul_shallow 225063
famat_mulpow_shallow 88316
famat_mulpows_shallow 147671
famat_pow 60642
famat_pow_shallow 62001
famat_pows_shallow 152021
famat_reduce 306365
famat_remove_trivial 67000
famat_sqr 22979
famat_sub 20899
famat_to_Fp_coprime 665
famat_to_nf 0
famat_to_nf_moddivisor 18606
famatsmall_reduce 184676
get_random_a 117741
gpidealfactor 189
gpidealval 7119
hnf_QC_QC 7
hnf_Q_Q 21
hnf_Q_QC 77
hnf_Z_QC 70
hnf_Z_ZC 77
idealHNF_Z_factor 0
idealHNF_Z_factor_i 293987
idealHNF_factor 240104
idealHNF_factor_i 293988
idealHNF_inv 69862
idealHNF_inv_Z 211936
idealHNF_mul 474480
idealHNF_mul_two 975199
idealHNF_norm_pval 4248352
idealHNF_val 4386040
idealadd 83578
idealaddmultoone 35
idealaddtoone 98
idealaddtoone0 70
idealaddtoone_i 17633
idealaddtoone_raw 785570
idealappr 14
idealappr0 14
idealapprfact 0
idealapprfact_i 54082
idealcoprime 84
idealcoprimefact 37191
idealdiv 39744
idealdiv0 56
idealdivexact 5263
idealdivpowprime 13007
idealdown 3031
idealfactor 268301
idealfactor_limit 268729
idealfactor_partial 25515
idealhnf 665
idealhnf0 413
idealhnf_principal 1391719
idealhnf_shallow 1855816
idealhnf_two 802890
idealintersect 21
idealinv 115840
idealismaximal 77
idealismaximal_i 77
idealismaximal_int 42
idealismaximal_mat 21
idealispower 3906
idealmin 7
idealmul 512017
idealmul0 70
idealmul_aux 512017
idealmulelt 266228
idealmulpowprime 828309
idealmulred 17221
idealnorm 105784
idealnumden 389743
idealpow 942571
idealpow0 2499
idealpow_aux 942569
idealpowprime 1309835
idealpowred 80025
idealpows 313338
idealprod 1064
idealprodprime 666
idealprodval 1917
idealpseudomin 142431
idealpseudomin_nonscalar 0
idealpseudominvec 1252979
idealpseudored 1344890
idealred0 138496
idealred_elt 13400
idealredmodpower 59191
idealredmodpower_i 118368
idealsqr 39240
idealsqr_aux 39240
idealsqrprime 317619
idealsqrtn_int 7756
idealtwoelt 97410
idealtwoelt0 2485
idealtwoelt2 42
idealtyp 16544970
idealval 9801665
in_ideal 28
isideal 91
lcmuu 1638900
make_integral 10920
mat_ideal_two_elt 250558
mat_ideal_two_elt2 21
matreduce 63
nfV_eltembed 84
nfV_idealhnf 84
nf_coprime_part 126
nf_get_Gtwist 138503
nf_get_Gtwist1 12667
nf_remove_denom_p 4376663
nf_to_Fp_coprime 119798
nfdivmodpr 0
nfkermodpr 0
nfmulmodpr 7
nfpowmodpr 0
nfsolvemodpr 0
nfweilheight 84
nfweilheight_i 84
not_in_ideal 14
ok_elt 225087
p_makecoprime 94890
prV_e_muls 28492
prV_lcm_capZ 80948
prV_primes 66234
pr_hnf 3801276
pr_inv 17870
pr_inv_p 38327
pr_uniformizer 58373
ramified_root 7749
ramified_root_simple 7
sunits_makecoprime 98
to_Fp_coprime 122255
to_famat 0
to_famat_shallow 2768078
trivial_merge 28
twistG 12709
u_ppo 54297642
vec_mulid 91
vecdiv 903
vecinv 826
vecmul 16004713
vecpow 0
vecsqr 185983
zk_pvalrem 4330861

Generated by: LCOV version 1.16