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 30773-2078653b96) Lines: 1467 1530 95.9 %
Date: 2026-04-03 09:26:58 Functions: 116 119 97.5 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
FFT 56
FFT_i 98
FFTinv 56
QX_complex_roots 296307
RgX_gtofp_bit 7048016
RgX_normalize1 35705
X2XP1 5990576
ZX_Uspensky 1313968
ZX_Uspensky_equal 28
ZX_Uspensky_equal_yes 14
ZX_Uspensky_no 21
ZX_deg1root 15200
ZX_graeffe 5439
ZX_realroots_irred 48569
ZX_rescale2prim 2233781
ZX_sturm 6395
ZX_sturm_i 123065
ZX_sturm_irred 116670
ZX_sturmpart 1128371
ZX_to_ZiX 16491845
ZiX_sqr 99230973
_gen_nored 11200113
_gen_one 14472075
_gen_zero 326006
_intervalcmp 0
_mp_add 24660793
_mp_cmul 34761453
_mp_mul 4374452
_mp_sqr 6298475
_mp_sub 0
_sqrtnr 22593
a_posteriori_errors 537472
abs_update 8021299
abs_update_r 780114
all_roots 536366
append_clone 1616154
bkeval_single_power 5235549
check_ab 1178999
checkbound 2355128
checkvalidpol 267214
clean_roots 536411
cleanroots 231763
cmp_complex_appr 2241479
conformal_basecase 1406446
conformal_mapping 468775
conformal_pol 1406566
dblexp 6562479
dbllog2 304005440
dft 503321
dual_modulus 1014478
eval_rel_pol 13168397
fft 14194441
fft2 7462
findpower 41030115
fix_roots 537471
fix_roots1 398790
fujiwara_bound 2272064
fujiwara_bound_real 1407033
graeffe 49603574
homothetie 1613560
homothetie2n 9978981
homothetie_gauss 36564368
ind_maxlog2 904347
initdft 998244
isexactpol 240103
isexactscalar 934017
isreal 963698
isvalidcoeff 1230445
logmax_modulus 4458569
logmin_modulus 1617679
logmodulus 608214
logpre_modulus 608217
logradius 494921
lower_bound 41029411
mydbllog2i 226868763
mydbllog2r 57611930
mydbllogr 9565599
mygprec 63862746
mygprec_absolute 4344161
mygprec_special 537471
mygprecrc 215578631
mygprecrc_special 2181406
myshiftic 136080537
myshiftrc 35576579
newton_polygon 5520743
optimize_split 494925
parameters 494925
pol_to_gaussint 17627003
polgraeffe 14
polmod_to_embed 84
polrootsbound 27104
polrootsbound_i 27097
polsolve 166704
quicktofp 6981377
realroots 50627
refine_F 503315
refine_H 2464601
root_error 1914392
roots 8368
roots_aux 240131
roots_com 240103
rootsdeg0 42
scalepol 4297336
scalepol2n 0
sol_ok 3378
solve_exact_pol 231495
split_0 495294
split_0_1 469144
split_0_2 469144
split_1 468776
split_2 494925
split_complete 1528057
split_fromU 494925
split_pols 166695
splitcauchy 166711
splitpoleval 5235273
tocomplex 1215861
update_radius 494925
usp 1126111

Generated by: LCOV version 1.16