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 - gen3.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30674-be81ecfdd4) Lines: 2476 2664 92.9 %
Date: 2026-02-12 09:23:52 Functions: 237 247 96.0 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Itos 19103
QpV_to_QV 196
Qp_to_Q 735
RgC_RgV_mulrealsym 21630
RgM_mulreal 0
RgXY_cxevalx 63
RgX_cxeval 2441109
RgX_deflate_max 728872
RgX_deflate_order 1133308
RgX_degree 566817
RgX_derivn 833
RgX_integ 105
ZX_deflate_max 327566
ZX_deflate_order 526325
_abs 518
_egal 108993237
_egal_i 108993245
_gtopoly 3476950
_polcoef 2600538
_quot 875
_quotfi 7
_quotfs 301
_quotqs 28
_quotri 7
_quotrs 28
_quotsf 35
_quotsq 70
_quotsr 70
_rfraccoef 21
_sercoef 111958
ceil_safe 1056634
ceilr 2504
centerlift 60473
centerlift0 707
centerliftii 42518
compo 327
constmat 14
content0 131005
deg1pol 247137
deg1pol_shallow 8891118
deg2pol_shallow 321226
degree 11314
denom 228909
denom_i 12319026
denominator 128149
denominator_v 287
denompol 119
deriv 114128
derivn 1379
derivnser 210
derivser 25872
diffop 3535
diffop0 42
diviiround 64753439
divrem 1057
err_intformal 35
floor_safe 72065
gceil 235566
gcvtoi 1140246
gdeflate 14231
gdivent 6204674
gdiventgs 326313
gdiventres 1064
gdiventsg 6202486
gdivmod 0
gdivround 1459140
gdvd 15884
geq 47668177
geval 0
geval_gp 11020
gfloor 5360100
gfrac 426531
gge 248443
ggrando 7084
ggt 2374976
gimag 29365
gle 7628237
glt 6328228
gmod 46155650
gmodgs 22029330
gmodsg 44997997
gmodulo 1938387
gmodulsg 1321854
gmodulss 1054657
gne 61325067
gnot 606081
gppadicprec 105
gppoldegree 31231
gprecision 14433246
gpserprec 42
greal 6958
grndtoi 91629434
ground 2837191
gshift 47152450
gsubst 2708743
gsubst_v 84
gsubstpol 8302
gsubstvec 980
gtocol 350
gtocol0 4004
gtocolrev 0
gtocolrev0 294
gtopoly 1042908
gtopolyrev 2434040
gtovec 119447
gtovec0 123878
gtovecpost 1092
gtovecpre 3829
gtovecrev 0
gtovecrev0 308
gtovecsmall 19040
gtovecsmall0 7784
gtovecsmallpost 98
gtovecsmallpre 98
gtrunc 597763
gtrunc2n 117383636
gvar 131683635
gvar2 20671883
gvar9 59465
hqfeval 168
imag_i 299015527
init_qf_apply 504697
init_vectopre 3773
integ 350
integ_act 14
integser 26516
is_realext 177888
is_realquad 1099
iscomplex 0
isinexact 129210090
isinexactreal 14357
isint 486854
isrationalzeroscalar 0
isrealappr 1885696
issmall 326463
lift 2204750
lift0 2521568
lift_shallow 651662
liftall 26250
liftall_shallow 2003694
liftint 119
liftint_shallow 546
liftpol 5726
liftpol_shallow 22009725
listdeflate 21
lookup 833
mkcoln 1379
mkintn 24531
mkpoln 5600832
mkvecn 1218908
mkvecsmalln 134029
modRr_i 5097895
modRr_safe 0
mod_r 210
modrs 14
modsf 35
modsr 35
mulimag 103649
mulreal 15739618
numer 8631
numer_i 9050429
numerator 8925
op_ReIm 203607802
padic_to_Q 689494
padic_to_Q_shallow 14
padicprec 4172
padicprec_relative 2303
polcoef 727580
polcoef_i 3612608
poldeflate 8302
poldegree 146461
poleval 13392256
pollead 1211
prec0 9752857
precCOMPLEX 21398359
precREAL 970337257
precision 981672874
precrealexact 878757
qf_RgM_apply 7663
qf_ZM_apply 497034
qfb_ZM_apply 14
qfb_ZM_apply_i 14
qfbeval 347816
qfbevalb 7
qfbil 0
qfeval 17023
qfeval0 348075
qfevalb 567
qfnorm 0
qfnorm0 348019
quad_floor 518
quot 777
quotfi 7
quotfs 301
quotqs 14
quotrem 518
quotri 7
quotrs 14
quotsf 35
quotsq 35
quotsr 35
real_i 322229786
recvar 75236
rfrac_deriv 56
rfrac_derivn 42
round0 6097
round_i 54188716
roundr 3136016
roundr_safe 302714
safe_polmod 1358
scalarmat2 56
scalarpol 45229141
scalarpol_shallow 3631148
ser2pol_i 10063944
ser2pol_i_normalize 761127
ser2rfrac 707
ser2rfrac_i 11487
ser_inv 46746
ser_unscale 4193
serdeflate 5866
serdiffop 7
serequalXk 21588
serprec 70
serreverse 98
sertrunc 70
sertrunc_copy 2317
simplify 11571801
simplify_shallow 571005154
subst_higher 725410
subst_polmod 574
swapvar_act 28
tayl 21
tayl_act 14
trunc0 217
uu32toi 328547
uu32toineg 114638
var2_aux 10710
var2_polmod 3479
var2_rfrac 7231
variables_vec 42
variables_vecsmall 1288
vdeflate 63
vec_padicprec 826
vec_padicprec_relative 399
vec_serprec 14
vecdenom 242315
vecdenompol 14

Generated by: LCOV version 1.16