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 30605-980f9eb85c) Lines: 1467 1530 95.9 %
Date: 2026-01-12 09:21:57 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 15200
_sqrtnr 22595
polrootsbound_i 27125
polrootsbound 27132
RgX_normalize1 35733
ZX_realroots_irred 48562
realroots 50627
ZX_sturm_irred 116582
ZX_sturm_i 122977
split_pols 166690
polsolve 166696
splitcauchy 166697
solve_exact_pol 231145
cleanroots 231763
isexactpol 239753
roots_com 239753
roots_aux 239781
checkvalidpol 266892
QX_complex_roots 296159
_gen_zero 326007
fix_roots1 398344
split_1 467766
conformal_mapping 467767
split_0_1 468132
split_0_2 468132
logradius 493819
split_2 493820
update_radius 493821
optimize_split 493824
parameters 493824
split_fromU 493824
split_0 494189
refine_F 502212
dft 502213
all_roots 535867
clean_roots 535913
fix_roots 536967
a_posteriori_errors 536974
mygprec_special 536975
logpre_modulus 606534
logmodulus 606537
abs_update_r 778541
ind_maxlog2 902386
isexactscalar 931714
isreal 961590
initdft 996021
dual_modulus 1012153
usp 1125975
ZX_sturmpart 1128262
check_ab 1178890
tocomplex 1213132
isvalidcoeff 1228149
ZX_Uspensky 1313758
conformal_basecase 1403413
conformal_pol 1403531
fujiwara_bound_real 1406749
split_complete 1525345
homothetie 1609564
append_clone 1613476
logmin_modulus 1614247
root_error 1911569
mygprecrc_special 2178222
ZX_rescale2prim 2233637
cmp_complex_appr 2237212
fujiwara_bound 2271032
checkbound 2354910
refine_H 2459837
scalepol 4287999
mygprec_absolute 4337344
_mp_mul 4374398
logmax_modulus 4449286
bkeval_single_power 5234599
splitpoleval 5235014
newton_polygon 5505089
X2XP1 5990029
_mp_sqr 6297986
dblexp 6546980
quicktofp 6976733
RgX_gtofp_bit 7028914
abs_update 8003201
mydbllogr 9543942
homothetie2n 9954101
_gen_nored 11198897
eval_rel_pol 13133889
fft 14154483
_gen_one 14469961
ZX_to_ZiX 16445627
pol_to_gaussint 17583068
_mp_add 24661177
_mp_cmul 34759505
myshiftrc 35493927
homothetie_gauss 36484899
lower_bound 40940844
findpower 40940917
graeffe 49493499
mydbllog2r 56168076
mygprec 63738857
ZiX_sqr 99001361
myshiftic 135791719
mygprecrc 215108732
mydbllog2i 226342820
dbllog2 302002880

Generated by: LCOV version 1.16