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-09-06 17:02:10 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 381837
padic_to_Fl 421719
cmpifrac 456500
vecindexmax 503449
cvtop 600631
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 1839872
factorial_lval 1995391
Z_pvalrem_DC 2159098
_domul 2258886
gassoc_proto 2462808
cx_approx_equal 2499436
cx_approx0 2507125
u_pvalrem 2634795
gequal_try 3195602
roughtype 3257649
cmp_str 3681020
ZV_pvalrem 4183556
ZX_pvalrem 4318730
cmpfrac 4595760
gen_2valrem 4924052
glength 5150313
vecidentical 5440883
vecequal 5577412
polidentical 5634065
Q_lvalrem 6303023
Q_pvalrem 6304619
gen_lvalrem 8490041
gen_pvalrem 8502286
gequalX 8509503
Q_pval 9427849
Q_lval 9432040
polequal 12918186
map_proto_lG 13899380
isless_iu 15103276
normalizeser 15686279
itop2_coprime 17618519
cvtop2 17625449
is_monomial_test 22631578
cmp_universal_rec 39285431
Z_pval 50415264
gabs 53745167
gisexactzero 57171721
Z_lvalrem 65076570
Z_lval 68999635
Z_pvalrem 69976171
u_lval 71120116
gequalm1 74234552
gsigne 84461531
cmp_universal 89011797
u_lvalrem 90419965
normalizepol 99746266
Z_lvalrem_stop 118027913
gidentical 123903166
u_lvalrem_stop 136206563
gneg_i 138756131
gcmp 231805026
gequal 244377604
gequal1 342290655
gneg 473029019
isexactzero 582934707
isrationalzero 792814419
gexpo 889807121
gexpo_safe 890094155
normalizepol_lg 946193807
gequal0 2541600817

Generated by: LCOV version 2.0-1