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 30702-bddb8d6928) Lines: 1696 1847 91.8 %
Date: 2026-02-23 02:23:56 Functions: 170 185 91.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fl_invgen 4963172
Q_nffactor 24297
Q_to_famat 156893
RM_round_maxrank 83483
ZM_famat_limit 486599
ZV_cba 24
ZV_cba_extend 41
Z_cba 649079
Z_cba_rec 5852217
Z_dcba_rec 0
Z_ppgle 0
Z_ppio 845128
Z_ppo 16186907
Z_to_famat 298633
_idealaddtoone 686359
_idealmulred 23709
_idealsqrred 29731
_mul 9508
_sqr 29731
addmul_mat 54985
append 131877
chk_vdir 18
err_divexact 6
ext_inv 17386
ext_mul 50455
ext_pow 0
ext_sqr 28233
factorbackprime 64360
famatV_factorback 11343
famatV_zv_factorback 48105
famat_Z_gcd 0
famat_add 137587
famat_div 159549
famat_div_shallow 8083
famat_idealfactor 0
famat_inv 158929
famat_inv_shallow 20510
famat_makecoprime 1878149
famat_mul 373080
famat_mul_shallow 185936
famat_mulpow_shallow 71275
famat_mulpows_shallow 125213
famat_pow 51979
famat_pow_shallow 48395
famat_pows_shallow 128345
famat_reduce 260288
famat_remove_trivial 56589
famat_sqr 19500
famat_sub 17803
famat_to_Fp_coprime 560
famat_to_nf 0
famat_to_nf_moddivisor 15934
famatsmall_reduce 139958
get_random_a 95212
gpidealfactor 162
gpidealval 6102
hnf_QC_QC 6
hnf_Q_Q 18
hnf_Q_QC 64
hnf_Z_QC 58
hnf_Z_ZC 64
idealHNF_Z_factor 0
idealHNF_Z_factor_i 251162
idealHNF_factor 205012
idealHNF_factor_i 251162
idealHNF_inv 56955
idealHNF_inv_Z 177206
idealHNF_mul 396628
idealHNF_mul_two 826083
idealHNF_norm_pval 3569841
idealHNF_val 3685896
idealadd 68332
idealaddmultoone 30
idealaddtoone 77
idealaddtoone0 60
idealaddtoone_i 14286
idealaddtoone_raw 672073
idealappr 12
idealappr0 12
idealapprfact 0
idealapprfact_i 45597
idealcoprime 65
idealcoprimefact 31392
idealdiv 32052
idealdiv0 48
idealdivexact 4471
idealdivpowprime 11052
idealdown 2569
idealfactor 229052
idealfactor_limit 229414
idealfactor_partial 21816
idealhnf 563
idealhnf0 350
idealhnf_principal 1176454
idealhnf_shallow 1577715
idealhnf_two 684967
idealintersect 18
idealinv 94006
idealismaximal 66
idealismaximal_i 66
idealismaximal_int 36
idealismaximal_mat 18
idealispower 3325
idealmin 6
idealmul 414277
idealmul0 59
idealmul_aux 414277
idealmulelt 211703
idealmulpowprime 706289
idealmulred 14201
idealnorm 90248
idealnumden 333156
idealpow 794795
idealpow0 2142
idealpow_aux 794795
idealpowprime 1118301
idealpowred 67510
idealpows 267981
idealprod 888
idealprodprime 571
idealprodval 1538
idealpseudomin 120233
idealpseudomin_nonscalar 0
idealpseudominvec 1052559
idealpseudored 1130891
idealred0 116327
idealred_elt 11515
idealredmodpower 50644
idealredmodpower_i 101276
idealsqr 32711
idealsqr_aux 32711
idealsqrprime 271190
idealsqrtn_int 6603
idealtwoelt 82785
idealtwoelt0 2130
idealtwoelt2 36
idealtyp 13922448
idealval 8248864
in_ideal 24
isideal 78
lcmuu 1377709
make_integral 9352
mat_ideal_two_elt 204038
mat_ideal_two_elt2 18
matreduce 54
nfV_eltembed 60
nfV_idealhnf 60
nf_coprime_part 108
nf_get_Gtwist 116333
nf_get_Gtwist1 10768
nf_remove_denom_p 3639031
nf_to_Fp_coprime 101025
nfdivmodpr 0
nfkermodpr 0
nfmulmodpr 6
nfpowmodpr 0
nfsolvemodpr 0
nfweilheight 60
nfweilheight_i 60
not_in_ideal 12
ok_elt 184825
p_makecoprime 74284
prV_e_muls 24358
prV_lcm_capZ 68605
prV_primes 56710
pr_hnf 3232242
pr_inv 15200
pr_inv_p 32256
pr_uniformizer 48978
ramified_root 6597
ramified_root_simple 6
sunits_makecoprime 84
to_Fp_coprime 102866
to_famat 0
to_famat_shallow 2333572
trivial_merge 24
twistG 10804
u_ppo 42136020
vec_mulid 66
vecdiv 645
vecinv 708
vecmul 13816343
vecpow 0
vecsqr 159414
zk_pvalrem 3604764

Generated by: LCOV version 1.16