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 31042-0fbe168e69) Lines: 93.6 % 1667 1561
Test Date: 2026-07-23 17:04:59 Functions: 94.9 % 158 150
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
Q_lval 9431819
Q_lvalrem 6303023
Q_pval 9427628
Q_pvalrem 6304619
ZV_Z_dvd 1414
ZV_lval 0
ZV_lvalrem 0
ZV_pval 30934
ZV_pvalrem 4183603
ZXV_pval 0
ZXV_pvalrem 0
ZXX_pval 952
ZXX_pvalrem 2849
ZX_gen_pvalrem 3801
ZX_lval 788796
ZX_lvalrem 721
ZX_pval 104292
ZX_pvalrem 4318648
Z_lval 68998002
Z_lvalrem 65076147
Z_lvalrem_stop 118016556
Z_pval 50414163
Z_pvalrem 69974560
Z_pvalrem_DC 2159430
_Fp_div 163005
_domul 2258886
affgc 2590
chk_true_err 189
closure_identical 70
cmp_str 3681020
cmp_universal 89011435
cmp_universal_rec 39285396
cmpfrac 4595760
cmpgen 224
cmpifrac 455849
cmprfrac 81756
col_test 294560
ctop 14
cvstop2 399
cvtop 600646
cvtop2 17625449
cx_approx0 2507104
cx_approx_equal 2499437
ensure_nb 810971
factorial_lval 1995486
frac_lval 381841
frac_val 292596
gabs 53744467
gassoc_proto 2462813
gcmp 231723221
gcmpsg 762273
gcvtop 126
gen_2val 816027
gen_2valrem 4924010
gen_Z_divides 6855
gen_lval 913697
gen_lvalrem 8490006
gen_pval 135226
gen_pvalrem 8502251
gen_pvalrem_DC 11752
gen_z_divides 4935
gequal 244360278
gequal0 2541457328
gequal1 342287988
gequalX 8509509
gequal_try 3195604
gequalm1 74234553
gequalsg 44058
gexpo 889748559
gexpo_safe 890035593
gidentical 123903290
gisexactzero 57171910
glength 5150313
gmax 79310
gmaxgs 0
gmequal_try 28
gmin 12180
gmings 0
gneg 473022608
gneg_i 138747808
gpexponent 90285
gpvaluation 3934
gsigne 84282253
gtolist 5972
gtolong 77
gtranslength 3878
gvaluation 1401625
identicalrr 1547
intdvd 91
is_monomial_test 22631522
is_negative 0
isexactzero 582929667
isless_iu 15102562
isrationalzero 792799664
itop2_coprime 17618519
lexcmp 1628653
lexcmp_i 1628653
lexcmp_s_matvec 21
lexcmp_scal_matvec 357
lexcmp_scal_vecsmall 42
lexcmp_similar 372161
lexcmp_vec_mat 98
lexcmp_vecsmall_mat 42
lexcmp_vecsmall_other 196
lexcmp_vecsmall_vec 154
lexcmpgs 42
lexcmpsg 343
list_cmp 343
listinsert 35014
listinsert0 35028
listpop 21917
listpop0 56
listput 776125
listput0 724955
listsort 21
map_proto_G 462
map_proto_lG 13885874
map_proto_lGL 126
mat_test 16366
matsize 1862
minval 137186
mklist 6870
mklist_typ 6926
mklistcopy 70
mkmap 49
normalizepol 99744700
normalizepol_approx 0
normalizepol_lg 946181605
normalizeser 15686279
padic_to_Fl 421719
padic_to_Fp 4550
polequal 12918186
polidentical 5634065
qtop 42
quadtofp 252
r_approx0 1808992
roughtype 3257649
serequal 420
seridentical 14
sizedigit 7
u_lval 71118988
u_lvalrem 90419619
u_lvalrem_stop 136195856
u_pval 137019
u_pvalrem 2634774
vecequal 5577413
vecidentical 5440904
vecindexmax 503448
vecindexmin 183130
vecmax 66207
vecmax0 227037
vecmin 35353
vecmin0 147521
z_lval 1839896
z_lvalrem 87353
z_pval 1318037
z_pvalrem 399
zx_lval 28931

Generated by: LCOV version 2.0-1