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 30711-c92306d4b4) Lines: 1467 1530 95.9 %
Date: 2026-02-24 09:25:14 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 5390
ZX_sturm 6395
fft2 7462
roots 8018
ZX_deg1root 15205
_sqrtnr 22597
polrootsbound_i 27125
polrootsbound 27132
RgX_normalize1 35733
ZX_realroots_irred 48570
realroots 50627
ZX_sturm_irred 116586
ZX_sturm_i 122981
polsolve 166698
split_pols 166700
splitcauchy 166700
solve_exact_pol 231145
cleanroots 231763
isexactpol 239753
roots_com 239753
roots_aux 239781
checkvalidpol 266892
QX_complex_roots 296179
_gen_zero 326027
fix_roots1 398352
conformal_mapping 467808
split_1 467809
split_0_1 468169
split_0_2 468170
logradius 493856
split_2 493856
split_fromU 493857
parameters 493858
update_radius 493858
optimize_split 493859
split_0 494223
refine_F 502243
dft 502247
all_roots 535888
clean_roots 535931
a_posteriori_errors 536986
fix_roots 536987
mygprec_special 536993
logmodulus 606569
logpre_modulus 606572
abs_update_r 778564
ind_maxlog2 902471
isexactscalar 931714
isreal 961667
initdft 996105
dual_modulus 1012236
usp 1125930
ZX_sturmpart 1128177
check_ab 1178803
tocomplex 1213225
isvalidcoeff 1228149
ZX_Uspensky 1313681
conformal_basecase 1403540
conformal_pol 1403646
fujiwara_bound_real 1406665
split_complete 1525435
homothetie 1609692
append_clone 1613547
logmin_modulus 1614377
root_error 1911662
mygprecrc_special 2178304
ZX_rescale2prim 2233538
cmp_complex_appr 2237360
fujiwara_bound 2271076
checkbound 2354736
refine_H 2460021
scalepol 4288338
mygprec_absolute 4337676
_mp_mul 4374655
logmax_modulus 4449712
bkeval_single_power 5235202
splitpoleval 5236264
newton_polygon 5505433
X2XP1 5989777
_mp_sqr 6298493
dblexp 6547527
quicktofp 6976972
RgX_gtofp_bit 7029326
abs_update 8004093
mydbllogr 9545025
homothetie2n 9954820
_gen_nored 11210516
eval_rel_pol 13135025
fft 14155939
_gen_one 14473858
ZX_to_ZiX 16451622
pol_to_gaussint 17584628
_mp_add 24665743
_mp_cmul 34781519
myshiftrc 35497344
homothetie_gauss 36493418
findpower 40947431
lower_bound 40947632
graeffe 49504517
mydbllog2r 56172646
mygprec 63746026
ZiX_sqr 99023933
myshiftic 135861580
mygprecrc 215133410
mydbllog2i 226405873
dbllog2 302092097

Generated by: LCOV version 1.16