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

Generated by: LCOV version 1.16