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 - rootpol.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30824-18397de1d0) Lines: 1467 1530 95.9 %
Date: 2026-04-19 09:25:48 Functions: 116 119 97.5 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
_intervalcmp 0
_mp_sub 0
scalepol2n 0
ZX_Uspensky_equal_yes 14
polgraeffe 14
ZX_Uspensky_no 21
ZX_Uspensky_equal 28
rootsdeg0 42
FFT 56
FFTinv 56
polmod_to_embed 84
FFT_i 98
sol_ok 3378
ZX_graeffe 5439
ZX_sturm 6395
fft2 7462
roots 8382
ZX_deg1root 15204
_sqrtnr 22596
polrootsbound_i 27097
polrootsbound 27104
RgX_normalize1 35705
ZX_realroots_irred 48572
realroots 50627
ZX_sturm_irred 116676
ZX_sturm_i 123071
polsolve 166699
split_pols 166702
splitcauchy 166709
solve_exact_pol 231509
cleanroots 231763
isexactpol 240117
roots_com 240117
roots_aux 240145
checkvalidpol 267228
QX_complex_roots 296316
_gen_zero 325977
fix_roots1 398807
split_1 468814
conformal_mapping 468815
split_0_1 469185
split_0_2 469185
parameters 494966
update_radius 494966
logradius 494967
split_2 494969
split_fromU 494970
optimize_split 494971
split_0 495338
refine_F 503365
dft 503372
all_roots 536384
clean_roots 536432
fix_roots 537487
a_posteriori_errors 537491
mygprec_special 537495
logmodulus 608289
logpre_modulus 608298
abs_update_r 780214
ind_maxlog2 904416
isexactscalar 934122
isreal 963784
initdft 998341
dual_modulus 1014575
usp 1126085
ZX_sturmpart 1128282
check_ab 1178909
tocomplex 1216009
isvalidcoeff 1230557
ZX_Uspensky 1313882
conformal_basecase 1406566
conformal_pol 1406684
fujiwara_bound_real 1406964
split_complete 1528163
homothetie 1613739
append_clone 1616275
logmin_modulus 1617788
root_error 1914538
mygprecrc_special 2181549
ZX_rescale2prim 2233815
cmp_complex_appr 2241692
fujiwara_bound 2272873
checkbound 2354946
refine_H 2464737
scalepol 4297724
mygprec_absolute 4344484
_mp_mul 4374513
logmax_modulus 4458872
bkeval_single_power 5234625
splitpoleval 5234924
newton_polygon 5521409
X2XP1 5990657
_mp_sqr 6298160
dblexp 6563146
quicktofp 6984433
RgX_gtofp_bit 7048957
abs_update 8021444
mydbllogr 9566293
homothetie2n 9979969
_gen_nored 11200360
eval_rel_pol 13169975
fft 14196789
_gen_one 14469697
ZX_to_ZiX 16490439
pol_to_gaussint 17628731
_mp_add 24660893
_mp_cmul 34762298
myshiftrc 35580419
homothetie_gauss 36563137
findpower 41028319
lower_bound 41028806
graeffe 49604227
mydbllog2r 57618132
mygprec 63865644
ZiX_sqr 99220411
myshiftic 136089801
mygprecrc 215564752
mydbllog2i 226769220
dbllog2 303916935

Generated by: LCOV version 1.16