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 - gen2.c (source / functions) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31092-e6893b0017) Lines: 93.6 % 1668 1562
Test Date: 2026-12-03 17:02:49 Functions: 94.9 % 158 150
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
ZV_lval 0
ZV_lvalrem 0
ZXV_pval 0
ZXV_pvalrem 0
gmaxgs 0
gmings 0
is_negative 0
normalizepol_approx 0
sizedigit 7
ctop 14
seridentical 14
lexcmp_s_matvec 21
listsort 21
gmequal_try 28
lexcmp_scal_vecsmall 42
lexcmp_vecsmall_mat 42
lexcmpgs 42
qtop 42
mkmap 49
listpop0 56
closure_identical 70
mklistcopy 70
gtolong 77
intdvd 91
lexcmp_vec_mat 98
gcvtop 126
map_proto_lGL 126
lexcmp_vecsmall_vec 154
chk_true_err 189
lexcmp_vecsmall_other 196
cmpgen 224
quadtofp 252
lexcmpsg 343
list_cmp 343
lexcmp_scal_matvec 357
cvstop2 399
z_pvalrem 399
serequal 420
map_proto_G 462
ZX_lvalrem 721
ZXX_pval 952
ZV_Z_dvd 1414
identicalrr 1547
matsize 1869
affgc 2590
ZXX_pvalrem 2849
ZX_gen_pvalrem 3801
gtranslength 3878
gpvaluation 3934
padic_to_Fp 4550
gen_z_divides 4935
gtolist 5972
gen_Z_divides 6855
mklist 6870
mklist_typ 6926
gen_pvalrem_DC 11752
gmin 12180
mat_test 16366
listpop 21917
zx_lval 28931
ZV_pval 30934
listinsert 35014
listinsert0 35028
vecmin 35353
gequalsg 44058
vecmax 66207
gmax 79310
cmprfrac 81759
z_lvalrem 87353
gpexponent 90285
ZX_pval 104293
gen_pval 135227
u_pval 137019
minval 137186
vecmin0 147521
_Fp_div 163005
vecindexmin 183130
vecmax0 227037
frac_val 292596
col_test 294560
lexcmp_similar 372161
frac_lval 381835
padic_to_Fl 421719
cmpifrac 456500
vecindexmax 503448
cvtop 600645
listput0 724955
gcmpsg 762273
listput 776125
ZX_lval 788825
ensure_nb 810971
gen_2val 816056
gen_lval 913727
z_pval 1318037
gvaluation 1401625
lexcmp 1628653
lexcmp_i 1628653
r_approx0 1809019
z_lval 1839886
factorial_lval 1995480
Z_pvalrem_DC 2159099
_domul 2258886
gassoc_proto 2462803
cx_approx_equal 2499436
cx_approx0 2507119
u_pvalrem 2634697
gequal_try 3195602
roughtype 3257649
cmp_str 3681020
ZV_pvalrem 4183541
ZX_pvalrem 4318615
cmpfrac 4595760
gen_2valrem 4924026
glength 5150313
vecidentical 5440874
vecequal 5577412
polidentical 5634065
Q_lvalrem 6303023
Q_pvalrem 6304619
gen_lvalrem 8489911
gen_pvalrem 8502156
gequalX 8509516
Q_pval 9427623
Q_lval 9431814
polequal 12918186
map_proto_lG 13871952
isless_iu 15095916
normalizeser 15686279
itop2_coprime 17618519
cvtop2 17625449
is_monomial_test 22631503
cmp_universal_rec 39285732
Z_pval 50414188
gabs 53741752
gisexactzero 57171860
Z_lvalrem 65076224
Z_lval 68997988
Z_pvalrem 69975834
u_lval 71118620
gequalm1 74234554
gsigne 84461669
cmp_universal 89013015
u_lvalrem 90419122
normalizepol 99742080
Z_lvalrem_stop 118017293
gidentical 123903226
u_lvalrem_stop 136203259
gneg_i 138755415
gcmp 231777618
gequal 244377511
gequal1 342289977
gneg 473016761
isexactzero 582924866
isrationalzero 792805828
gexpo 889781783
gexpo_safe 890068817
normalizepol_lg 946173446
gequal0 2541553233

Generated by: LCOV version 2.0-1