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 - polarit2.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30734-f1f26dedcb) Lines: 2275 2518 90.3 %
Date: 2026-03-05 09:24:39 Functions: 215 225 95.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Q_mul_to_int 0
RgXQ_sqr_FpXQXQ 0
RgX_chinese_coprime 0
RgX_extgcd_simple 0
RgX_gcd_simple 0
RgX_halfgcd 0
RgX_halfgcd_all_FpXQX 0
pol_approx0 0
s_centermod 0
subresext 0
RgXQ_inv_FpXQXQ 7
RgX_extgcd_FpXQX 7
RgX_gcd_FpXQX 7
reduceddiscsmith 7
roots_to_pol_FqV 7
scalar_res 7
sylvestermatrix 7
FqV_factorback 14
RgXQ_charpoly_FpXQ 14
RgXQ_sqr_FpXQ 14
RgX_halfgcd_all_i 14
roots_to_pol_FpV 14
CX_factor 21
RgX_resultant_FpXQX 21
RX_factor 28
RgX_disc_FpXQX 28
RgX_halfgcd_all_FpX 28
RgX_resultant_FpX 28
newtonpoly 28
resultant2 28
Qi_factor_p 42
RgX_disc_FpX 42
Qi_factor 49
Qi_primpart 49
polfromroots 56
RgX_halfgcd_all 63
RgX_halfgcd_all_fast 63
zero_bezout 63
Qi_primpart_try 70
RgX_extresultant_FpX 77
Qi_cmp 91
ghalfgcd 91
RgX_fix_quadratic 98
fix_lcm 105
RgXQ_ratlift 112
scalar_bezout 112
random_FpX_monic 119
caract_const 126
RgX_extgcd_FpX 133
qgcd 154
primpart 168
RgV_type2 203
gc_gcdext 217
rnfcharpoly 224
FE_matconcat 252
RgXQ_factor 252
RgXQ_factor_i 252
RgXY_factor 252
RgXY_squff 252
RgX_Frobenius_deflate 259
RgXY_factor_squarefree 280
fix_pol 343
RgXQ_mul_FpXQXQ 385
sturmpart 385
Qi_gcd 399
gen_cmp_RgXY 399
RgX_disc_i 413
quadratic_to_RgX 420
Zi_rem 427
gbezout 427
gcdext0 427
zero_extgcd 434
ok_bloc 455
Qi_normal 469
RgX_gcd_FpXk 490
polresultant0 504
R_to_Q_down 525
R_to_Q_up 525
RgX_sturmpart 763
RgXQ_inv_i 848
Zi_mul3 854
sturmpart_i 1148
polresultantext 1393
c_zero_gcd 1400
RgX_extresultant_fast 1498
polresultantext0 1505
gcdmonome 1925
isinexactall 2170
RgX_gcd_ZXQX 2261
subresext_i 2276
FlxqV_factorback 2499
cont_gcd_gen 2635
padic_gcd 2726
glcm0 2898
RgX_gcd_QXQX 3003
c_is_rational 3255
triv_cont_gcd 3276
glcm 3297
ZV_lcm 3577
must_negate 4375
RgX_extgcd_fast 4529
poldisc0 4721
RgX_extgcd 4970
gcd3 6390
RgX_cmbf 6643
_lcmii 8145
vecprod 10003
RgX_liftred 10528
RgX_is_irred 11165
RgX_is_irred_i 11165
polisirreducible 11165
inexact 11396
subres_step 11650
RgXQ_inv_FpXQ 12054
RgXQ_charpoly 12909
RgXQ_charpoly_fast 12909
ZX_content 13244
Q_factor_limit 13789
RgX_factor 13839
Q_factor 21628
ginvmod 35231
RgX_rescale_to_int 37485
factor0 59410
factor 62378
factor_domain 63078
row_Q_primpart 63763
roots_from_deg1 63894
Flv_factorback 108623
RgX_gcd_FpX 108773
polsym 114188
vec_Q_primpart 121077
RgX_disc 124203
RgX_disc_fast 124203
polsym_gen 131604
RgXQ_inv 135258
RgXQ_inv_fast 135258
Lazard 137738
deg1_from_roots 157225
RgX_resultant_sylvester 169914
RgX_sylvestermatrix 169914
syl_RgM 169921
Fppow 244859
roots_to_pol_r1 264535
RgX_pseudodenom 271486
RgXQ_mul_FpXQ 274309
Lazard2 298237
RgX_neg_i 298237
nextSousResultant 298237
RgX_resultant_all 304582
syl_RgC 371755
RgXQ_sqr 465869
RgXQ_sqr_fast 465869
Q_div_to_int 515569
roots_to_pol_fast 776698
roots_to_pol 776772
RgV_type 776782
RgM_type 830576
cont_gcd_rfrac 846105
reductum_lg 891897
RgX_Rg_mul_i 893829
normalized_to_RgX 1041195
RgXQ_charpoly_i 1228739
resultant 1400651
resultant_fast 1400651
init_resultant 1400679
factorback 1476446
RgXQ_mul 1542784
RgXQ_mul_fast 1542784
RgX_type3 1542785
cont_gcd_pol 1652088
cont_gcd_pol_i 1652088
normalized_mul 1720977
Q_content 1837234
primitive_part 2066228
Z_content_v 2382067
RgX_type 2469149
cont_gcd 2500807
Q_denom 4106400
RgM_rescale_to_int 4709307
ggcd0 5203644
RgX_Rg_type 6070657
RgM_type2 7673115
zero_gcd 8170269
FpV_factorback 8570372
zero_gcd2 8781283
RgX_gcd 9327375
RgX_gcd_fast 9327375
Q_primpart 10021825
Z_content 10259279
Q_divq_to_int 10290667
RgX_type_decode 11220090
centermod 11245079
Q_divmuli_to_int 11557181
gcdiq 12789953
centermod_i 14759915
gdivexact 23975495
factorback2 25470548
ggcd 26910345
gcdqq 28378726
Fpmul 29351045
rescale_init 30077785
choosesubtype 31379097
RgM_RgC_type 33484689
gen_factorback 34387020
RgM_settype 49661095
Q_denom_v 55654430
mul 55743545
Q_remove_denom 57275017
content 71276420
powi 80750910
Q_primitive_part 87784018
centermodii 90006060
RgX_type2 108999921
Q_muli_to_int 143360471
RgX_type_is_composite 158607560
Rg_type 166614565
Q_divi_to_int 174393380
Q_content_v 179762703
Q_denom_safe 252806888
RgC_settype 273619594
choosetype 327913651
RgX_settype 454203948
Q_gcd 1013317920
Q_content_safe 1282569646
settype 3586933243

Generated by: LCOV version 1.16