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 30748-2ce22a5f1f) Lines: 1467 1530 95.9 %
Date: 2026-03-18 09:25:54 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 296305
RgX_gtofp_bit 7048101
RgX_normalize1 35705
X2XP1 5990771
ZX_Uspensky 1313840
ZX_Uspensky_equal 28
ZX_Uspensky_equal_yes 14
ZX_Uspensky_no 21
ZX_deg1root 15199
ZX_graeffe 5439
ZX_realroots_irred 48568
ZX_rescale2prim 2233894
ZX_sturm 6395
ZX_sturm_i 123068
ZX_sturm_irred 116673
ZX_sturmpart 1128239
ZX_to_ZiX 16492392
ZiX_sqr 99229579
_gen_nored 11203013
_gen_one 14471962
_gen_zero 325988
_intervalcmp 0
_mp_add 24662146
_mp_cmul 34765563
_mp_mul 4374574
_mp_sqr 6298291
_mp_sub 0
_sqrtnr 22592
a_posteriori_errors 537466
abs_update 8021475
abs_update_r 780129
all_roots 536367
append_clone 1616160
bkeval_single_power 5235047
check_ab 1178867
checkbound 2354863
checkvalidpol 267214
clean_roots 536412
cleanroots 231763
cmp_complex_appr 2241498
conformal_basecase 1406468
conformal_mapping 468783
conformal_pol 1406588
dblexp 6562643
dbllog2 304060154
dft 503326
dual_modulus 1014495
eval_rel_pol 13168533
fft 14194766
fft2 7462
findpower 41028428
fix_roots 537465
fix_roots1 398785
fujiwara_bound 2271936
fujiwara_bound_real 1406915
graeffe 49606545
homothetie 1613581
homothetie2n 9979058
homothetie_gauss 36563411
ind_maxlog2 904364
initdft 998257
isexactpol 240103
isexactscalar 934017
isreal 963713
isvalidcoeff 1230445
logmax_modulus 4458648
logmin_modulus 1617711
logmodulus 608223
logpre_modulus 608221
logradius 494926
lower_bound 41028815
mydbllog2i 226878007
mydbllog2r 57611534
mydbllogr 9565945
mygprec 63864956
mygprec_absolute 4344091
mygprec_special 537473
mygprecrc 215574590
mygprecrc_special 2181407
myshiftic 136125875
myshiftrc 35577292
newton_polygon 5520757
optimize_split 494933
parameters 494926
pol_to_gaussint 17627070
polgraeffe 14
polmod_to_embed 84
polrootsbound 27104
polrootsbound_i 27097
polsolve 166695
quicktofp 6981200
realroots 50627
refine_F 503319
refine_H 2464617
root_error 1914404
roots 8368
roots_aux 240131
roots_com 240103
rootsdeg0 42
scalepol 4297425
scalepol2n 0
sol_ok 3378
solve_exact_pol 231495
split_0 495303
split_0_1 469150
split_0_2 469151
split_1 468781
split_2 494932
split_complete 1528072
split_fromU 494931
split_pols 166695
splitcauchy 166711
splitpoleval 5235606
tocomplex 1215882
update_radius 494930
usp 1126071

Generated by: LCOV version 1.16