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 30862-ea47bd413c) Lines: 1467 1530 95.9 %
Date: 2026-05-06 09:26:47 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 15275
_sqrtnr 22668
polrootsbound_i 27230
polrootsbound 27237
RgX_normalize1 35838
ZX_realroots_irred 48652
realroots 50627
ZX_sturm_irred 116712
ZX_sturm_i 123107
polsolve 166731
split_pols 166734
splitcauchy 166745
solve_exact_pol 231509
cleanroots 231763
isexactpol 240117
roots_com 240117
roots_aux 240145
checkvalidpol 267361
QX_complex_roots 296336
_gen_zero 326042
fix_roots1 398827
conformal_mapping 468827
split_1 468828
split_0_1 469199
split_0_2 469199
logradius 494975
update_radius 494976
parameters 494978
optimize_split 494979
split_2 494979
split_fromU 494979
split_0 495349
dft 503375
refine_F 503376
all_roots 536413
clean_roots 536451
a_posteriori_errors 537508
fix_roots 537514
mygprec_special 537517
logmodulus 608289
logpre_modulus 608292
abs_update_r 780200
ind_maxlog2 904416
isexactscalar 934122
isreal 963804
initdft 998351
dual_modulus 1014584
usp 1126167
ZX_sturmpart 1128290
check_ab 1178917
tocomplex 1216015
isvalidcoeff 1231117
ZX_Uspensky 1313919
conformal_basecase 1406599
conformal_pol 1406718
fujiwara_bound_real 1407016
split_complete 1528204
homothetie 1613745
append_clone 1616323
logmin_modulus 1617844
root_error 1914592
mygprecrc_special 2181600
ZX_rescale2prim 2234004
cmp_complex_appr 2241664
fujiwara_bound 2274179
checkbound 2354963
refine_H 2464810
scalepol 4297815
mygprec_absolute 4344496
_mp_mul 4375576
logmax_modulus 4459123
splitpoleval 5236354
bkeval_single_power 5236868
newton_polygon 5521417
X2XP1 5991060
_mp_sqr 6299611
dblexp 6563296
quicktofp 6988242
RgX_gtofp_bit 7048894
abs_update 8022063
mydbllogr 9566978
homothetie2n 9980148
_gen_nored 11203668
eval_rel_pol 13169977
fft 14197101
_gen_one 14476091
ZX_to_ZiX 16495241
pol_to_gaussint 17629051
_mp_add 24663846
_mp_cmul 34770633
myshiftrc 35580962
homothetie_gauss 36566941
findpower 41032659
lower_bound 41032893
graeffe 49606370
mydbllog2r 57632224
mygprec 63867529
ZiX_sqr 99237620
myshiftic 136081732
mygprecrc 215593512
mydbllog2i 226781770
dbllog2 303936609

Generated by: LCOV version 1.16