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 30792-987d9c52f6) Lines: 1467 1530 95.9 %
Date: 2026-04-09 09:26:26 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 296304
RgX_gtofp_bit 7048058
RgX_normalize1 35703
X2XP1 5990903
ZX_Uspensky 1313938
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 2233922
ZX_sturm 6395
ZX_sturm_i 123063
ZX_sturm_irred 116667
ZX_sturmpart 1128335
ZX_to_ZiX 16490360
ZiX_sqr 99222444
_gen_nored 11198471
_gen_one 14471079
_gen_zero 326017
_intervalcmp 0
_mp_add 24661752
_mp_cmul 34758542
_mp_mul 4374496
_mp_sqr 6298396
_mp_sub 0
_sqrtnr 22593
a_posteriori_errors 537469
abs_update 8020754
abs_update_r 780141
all_roots 536363
append_clone 1616175
bkeval_single_power 5234781
check_ab 1178957
checkbound 2355068
checkvalidpol 267212
clean_roots 536413
cleanroots 231763
cmp_complex_appr 2241477
conformal_basecase 1406458
conformal_mapping 468775
conformal_pol 1406575
dblexp 6562486
dbllog2 303987485
dft 503323
dual_modulus 1014472
eval_rel_pol 13168195
fft 14194204
fft2 7462
findpower 41028043
fix_roots 537470
fix_roots1 398790
fujiwara_bound 2272040
fujiwara_bound_real 1407014
graeffe 49602311
homothetie 1613557
homothetie2n 9978930
homothetie_gauss 36561870
ind_maxlog2 904339
initdft 998250
isexactpol 240103
isexactscalar 934017
isreal 963712
isvalidcoeff 1230439
logmax_modulus 4458613
logmin_modulus 1617688
logmodulus 608217
logpre_modulus 608216
logradius 494924
lower_bound 41027374
mydbllog2i 226844539
mydbllog2r 57610633
mydbllogr 9565254
mygprec 63861430
mygprec_absolute 4344181
mygprec_special 537472
mygprecrc 215561243
mygprecrc_special 2181415
myshiftic 136072126
myshiftrc 35576552
newton_polygon 5520725
optimize_split 494930
parameters 494927
pol_to_gaussint 17626850
polgraeffe 14
polmod_to_embed 84
polrootsbound 27102
polrootsbound_i 27095
polsolve 166707
quicktofp 6981488
realroots 50627
refine_F 503314
refine_H 2464571
root_error 1914393
roots 8368
roots_aux 240131
roots_com 240103
rootsdeg0 42
scalepol 4297363
scalepol2n 0
sol_ok 3378
solve_exact_pol 231495
split_0 495296
split_0_1 469150
split_0_2 469150
split_1 468782
split_2 494926
split_complete 1528060
split_fromU 494930
split_pols 166706
splitcauchy 166713
splitpoleval 5234910
tocomplex 1215872
update_radius 494925
usp 1126154

Generated by: LCOV version 1.16