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.18.1 lcov report (development 31041-bd73e9fcdd) Lines: 93.6 % 1667 1561
Test Date: 2026-07-22 22:45:42 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 1862
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 66202
gmax 79310
cmprfrac 81756
z_lvalrem 87348
gpexponent 90285
ZX_pval 104292
gen_pval 135226
u_pval 136846
minval 137186
vecmin0 147521
_Fp_div 163005
vecindexmin 183130
vecmax0 227032
frac_val 292596
col_test 294560
lexcmp_similar 372163
frac_lval 381836
padic_to_Fl 421699
cmpifrac 455849
vecindexmax 503443
cvtop 600656
listput0 724955
gcmpsg 762253
listput 776125
ZX_lval 788796
ensure_nb 810971
gen_2val 816027
gen_lval 913697
z_pval 1318030
gvaluation 1401625
lexcmp 1628659
lexcmp_i 1628659
r_approx0 1808928
z_lval 1839847
factorial_lval 1995436
Z_pvalrem_DC 2159114
_domul 2258886
gassoc_proto 2462783
cx_approx_equal 2499437
cx_approx0 2507016
u_pvalrem 2634533
gequal_try 3195604
roughtype 3257661
cmp_str 3681020
ZV_pvalrem 4183523
ZX_pvalrem 4317914
cmpfrac 4595760
gen_2valrem 4923700
glength 5150313
vecidentical 5440823
vecequal 5577413
polidentical 5634065
Q_lvalrem 6302861
Q_pvalrem 6304453
gen_lvalrem 8489331
gen_pvalrem 8501435
gequalX 8509513
Q_pval 9427422
Q_lval 9431647
polequal 12918175
isless_iu 15102537
normalizeser 15686279
itop2_coprime 17612726
cvtop2 17619972
is_monomial_test 22631172
map_proto_lG 37435554
cmp_universal_rec 39285081
Z_pval 50412322
gabs 53725196
gisexactzero 57171801
Z_lvalrem 65060097
Z_lval 68995577
Z_pvalrem 69960562
u_lval 71116789
gequalm1 74234551
gsigne 84281262
cmp_universal 89010505
u_lvalrem 90399014
normalizepol 99685779
Z_lvalrem_stop 117185973
gidentical 123902947
u_lvalrem_stop 135102996
gneg_i 138729072
gequal 244359624
gcmp 255146150
gequal1 342203250
gneg 472757998
isexactzero 582549487
isrationalzero 792601127
gexpo 889394892
gexpo_safe 889687081
normalizepol_lg 945334068
gequal0 2539162329

Generated by: LCOV version 2.0-1