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 30762-238ab8e6c0) Lines: 1467 1530 95.9 %
Date: 2026-03-22 09:27:12 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 8368
ZX_deg1root 15203
_sqrtnr 22596
polrootsbound_i 27097
polrootsbound 27104
RgX_normalize1 35705
ZX_realroots_irred 48572
realroots 50627
ZX_sturm_irred 116674
ZX_sturm_i 123070
split_pols 166695
polsolve 166700
splitcauchy 166709
solve_exact_pol 231495
cleanroots 231763
isexactpol 240103
roots_com 240103
roots_aux 240131
checkvalidpol 267214
QX_complex_roots 296305
_gen_zero 326019
fix_roots1 398791
conformal_mapping 468780
split_1 468780
split_0_1 469150
split_0_2 469152
logradius 494922
split_2 494929
parameters 494930
optimize_split 494932
split_fromU 494932
update_radius 494932
split_0 495303
refine_F 503324
dft 503326
all_roots 536367
clean_roots 536415
fix_roots 537472
a_posteriori_errors 537473
mygprec_special 537475
logmodulus 608220
logpre_modulus 608221
abs_update_r 780135
ind_maxlog2 904366
isexactscalar 934017
isreal 963712
initdft 998254
dual_modulus 1014496
usp 1126132
ZX_sturmpart 1128337
check_ab 1178963
tocomplex 1215876
isvalidcoeff 1230445
ZX_Uspensky 1313936
conformal_basecase 1406454
conformal_pol 1406574
fujiwara_bound_real 1407008
split_complete 1528063
homothetie 1613580
append_clone 1616175
logmin_modulus 1617693
root_error 1914411
mygprecrc_special 2181408
ZX_rescale2prim 2233921
cmp_complex_appr 2241491
fujiwara_bound 2272044
checkbound 2355055
refine_H 2464577
scalepol 4297388
mygprec_absolute 4344235
_mp_mul 4374608
logmax_modulus 4458658
bkeval_single_power 5236319
splitpoleval 5236454
newton_polygon 5520785
X2XP1 5990911
_mp_sqr 6298690
dblexp 6562620
quicktofp 6981493
RgX_gtofp_bit 7048058
abs_update 8021401
mydbllogr 9565781
homothetie2n 9979150
_gen_nored 11209675
eval_rel_pol 13168667
fft 14194799
_gen_one 14475847
ZX_to_ZiX 16491180
pol_to_gaussint 17627300
_mp_add 24664938
_mp_cmul 34781735
myshiftrc 35577214
homothetie_gauss 36564984
lower_bound 41031487
findpower 41031785
graeffe 49610318
mydbllog2r 57613315
mygprec 63864905
ZiX_sqr 99237805
myshiftic 136143931
mygprecrc 215576005
mydbllog2i 226897174
dbllog2 304084251

Generated by: LCOV version 1.16