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 30766-abc2a9856c) Lines: 1467 1530 95.9 %
Date: 2026-03-27 09:27:04 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 15204
_sqrtnr 22598
polrootsbound_i 27094
polrootsbound 27101
RgX_normalize1 35702
ZX_realroots_irred 48573
realroots 50627
ZX_sturm_irred 116676
ZX_sturm_i 123071
polsolve 166703
split_pols 166703
splitcauchy 166707
solve_exact_pol 231495
cleanroots 231763
isexactpol 240103
roots_com 240103
roots_aux 240131
checkvalidpol 267211
QX_complex_roots 296306
_gen_zero 326014
fix_roots1 398790
conformal_mapping 468779
split_1 468780
split_0_1 469149
split_0_2 469149
logradius 494928
parameters 494930
update_radius 494930
split_2 494931
optimize_split 494932
split_fromU 494932
split_0 495301
refine_F 503320
dft 503325
all_roots 536366
clean_roots 536411
a_posteriori_errors 537459
fix_roots 537469
mygprec_special 537472
logpre_modulus 608219
logmodulus 608225
abs_update_r 780147
ind_maxlog2 904353
isexactscalar 934017
isreal 963711
initdft 998252
dual_modulus 1014489
usp 1126028
ZX_sturmpart 1128241
check_ab 1178868
tocomplex 1215875
isvalidcoeff 1230434
ZX_Uspensky 1313835
conformal_basecase 1406453
conformal_pol 1406573
fujiwara_bound_real 1406916
split_complete 1528067
homothetie 1613574
append_clone 1616157
logmin_modulus 1617676
root_error 1914411
mygprecrc_special 2181409
ZX_rescale2prim 2233763
cmp_complex_appr 2241483
fujiwara_bound 2271948
checkbound 2354864
refine_H 2464600
scalepol 4297408
mygprec_absolute 4344185
_mp_mul 4374718
logmax_modulus 4458605
splitpoleval 5236135
bkeval_single_power 5236276
newton_polygon 5520711
X2XP1 5990512
_mp_sqr 6298703
dblexp 6562584
quicktofp 6981276
RgX_gtofp_bit 7048117
abs_update 8021264
mydbllogr 9565675
homothetie2n 9979075
_gen_nored 11209581
eval_rel_pol 13168618
fft 14194709
_gen_one 14475820
ZX_to_ZiX 16492358
pol_to_gaussint 17627228
_mp_add 24666989
_mp_cmul 34784473
myshiftrc 35577668
homothetie_gauss 36565519
findpower 41028615
lower_bound 41029586
graeffe 49609419
mydbllog2r 57613148
mygprec 63865296
ZiX_sqr 99232162
myshiftic 136135167
mygprecrc 215575034
mydbllog2i 226897181
dbllog2 304075208

Generated by: LCOV version 1.16