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 30772-246cd0a587) Lines: 1467 1530 95.9 %
Date: 2026-03-29 09:27:34 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 48565
realroots 50627
ZX_sturm_irred 116660
ZX_sturm_i 123054
split_pols 166694
polsolve 166702
splitcauchy 166708
solve_exact_pol 231495
cleanroots 231763
isexactpol 240103
roots_com 240103
roots_aux 240131
checkvalidpol 267214
QX_complex_roots 296301
_gen_zero 325984
fix_roots1 398793
split_1 468773
conformal_mapping 468776
split_0_1 469143
split_0_2 469144
logradius 494924
split_2 494924
parameters 494926
update_radius 494926
optimize_split 494927
split_fromU 494927
split_0 495294
dft 503319
refine_F 503321
all_roots 536366
clean_roots 536411
fix_roots 537469
a_posteriori_errors 537473
mygprec_special 537475
logmodulus 608218
logpre_modulus 608219
abs_update_r 780141
ind_maxlog2 904356
isexactscalar 934017
isreal 963701
initdft 998244
dual_modulus 1014485
usp 1126085
ZX_sturmpart 1128334
check_ab 1178961
tocomplex 1215881
isvalidcoeff 1230445
ZX_Uspensky 1313914
conformal_basecase 1406441
conformal_pol 1406562
fujiwara_bound_real 1406979
split_complete 1528062
homothetie 1613570
append_clone 1616168
logmin_modulus 1617670
root_error 1914426
mygprecrc_special 2181421
ZX_rescale2prim 2233828
cmp_complex_appr 2241509
fujiwara_bound 2271987
checkbound 2355052
refine_H 2464574
scalepol 4297367
mygprec_absolute 4344263
_mp_mul 4374484
logmax_modulus 4458591
bkeval_single_power 5235831
splitpoleval 5236429
newton_polygon 5520753
X2XP1 5990691
_mp_sqr 6298444
dblexp 6562501
quicktofp 6981170
RgX_gtofp_bit 7048039
abs_update 8020990
mydbllogr 9565405
homothetie2n 9979096
_gen_nored 11210046
eval_rel_pol 13168549
fft 14194026
_gen_one 14473453
ZX_to_ZiX 16490387
pol_to_gaussint 17627164
_mp_add 24664709
_mp_cmul 34779759
myshiftrc 35576923
homothetie_gauss 36566078
lower_bound 41030982
findpower 41031048
graeffe 49613299
mydbllog2r 57611086
mygprec 63864914
ZiX_sqr 99236641
myshiftic 136164686
mygprecrc 215569588
mydbllog2i 226910026
dbllog2 304092303

Generated by: LCOV version 1.16