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-01 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 15205
_sqrtnr 22598
polrootsbound_i 27097
polrootsbound 27104
RgX_normalize1 35705
ZX_realroots_irred 48575
realroots 50627
ZX_sturm_irred 116673
ZX_sturm_i 123070
polsolve 166700
split_pols 166703
splitcauchy 166711
solve_exact_pol 231495
cleanroots 231763
isexactpol 240103
roots_com 240103
roots_aux 240131
checkvalidpol 267214
QX_complex_roots 296311
_gen_zero 326011
fix_roots1 398785
conformal_mapping 468775
split_1 468777
split_0_1 469147
split_0_2 469148
logradius 494923
split_2 494924
update_radius 494924
optimize_split 494927
parameters 494927
split_fromU 494927
split_0 495295
refine_F 503314
dft 503319
all_roots 536368
clean_roots 536412
fix_roots 537466
a_posteriori_errors 537468
mygprec_special 537474
logmodulus 608201
logpre_modulus 608203
abs_update_r 780117
ind_maxlog2 904342
isexactscalar 934017
isreal 963703
initdft 998244
dual_modulus 1014478
usp 1126062
ZX_sturmpart 1128278
check_ab 1178904
tocomplex 1215869
isvalidcoeff 1230445
ZX_Uspensky 1313876
conformal_basecase 1406444
conformal_pol 1406563
fujiwara_bound_real 1406946
split_complete 1528051
homothetie 1613549
append_clone 1616144
logmin_modulus 1617696
root_error 1914388
mygprecrc_special 2181398
ZX_rescale2prim 2233833
cmp_complex_appr 2241471
fujiwara_bound 2271982
checkbound 2354939
refine_H 2464573
scalepol 4297353
mygprec_absolute 4344202
_mp_mul 4374438
logmax_modulus 4458631
splitpoleval 5235278
bkeval_single_power 5235457
newton_polygon 5520627
X2XP1 5990635
_mp_sqr 6298450
dblexp 6562447
quicktofp 6981322
RgX_gtofp_bit 7047896
abs_update 8020860
mydbllogr 9565199
homothetie2n 9978922
_gen_nored 11199780
eval_rel_pol 13168316
fft 14194050
_gen_one 14471608
ZX_to_ZiX 16491858
pol_to_gaussint 17626986
_mp_add 24660385
_mp_cmul 34762134
myshiftrc 35576549
homothetie_gauss 36565782
findpower 41031059
lower_bound 41031197
graeffe 49607777
mydbllog2r 57611943
mygprec 63862632
ZiX_sqr 99236226
myshiftic 136112546
mygprecrc 215570670
mydbllog2i 226886447
dbllog2 304043735

Generated by: LCOV version 1.16