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) Hit Total Coverage
Test: PARI/GP v2.16.2 lcov report (development 29115-f22e516b23) Lines: 1577 1772 89.0 %
Date: 2024-04-27 08:08:04 Functions: 149 158 94.3 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Q_lval 6337571
Q_lvalrem 3902431
Q_pval 6333414
Q_pvalrem 3904119
ZV_Z_dvd 539
ZV_lval 0
ZV_lvalrem 0
ZV_pval 32496
ZV_pvalrem 3898543
ZX_lval 745830
ZX_lvalrem 721
ZX_pval 510516
ZX_pvalrem 3824067
Z_lval 24450664
Z_lvalrem 38210026
Z_lvalrem_stop 159456158
Z_pval 13572192
Z_pvalrem 30584073
Z_pvalrem_DC 2147399
_domul 2201967
cgetp 12416985
chk_true_err 189
closure_identical 70
cmp_str 602
cmp_universal 84045383
cmp_universal_rec 39036451
cmpfrac 4386935
cmpgen 161
cmpifrac 435395
cmprfrac 81114
col_test 292411
croak 0
ctop 14
cvstop2 399
cvtop 385814
cvtop2 6820865
cx_approx0 1851476
cx_approx_equal 53397
ensure_nb 791224
factorial_lval 2021937
frac_lval 535488
frac_val 291090
gabs 49813929
gaffect 661953
gaffsg 91812
gassoc_proto 2413812
gcmp 293188096
gcmpsg 613747
gcvtop 126
gen_2val 772208
gen_2valrem 4744188
gen_Z_divides 6592
gen_lval 1278492
gen_lvalrem 7710525
gen_pval 543012
gen_pvalrem 7722619
gen_pvalrem_DC 11441
gen_z_divides 4886
gequal 232189418
gequal0 2221189121
gequal1 312297427
gequalX 1483063
gequal_try 3193345
gequalm1 74216421
gequalsg 41664
gexpo 645475479
gexpo_safe 645711177
gidentical 61840633
gisexactzero 63703839
glength 5141924
gmax 78995
gmaxgs 0
gmequal_try 28
gmin 12173
gmings 0
gneg 447012133
gneg_i 128032664
gpexponent 89599
gpvaluation 3808
gsigne 73714951
gtolist 5538
gtolong 77
gtranslength 0
gvaluation 1162848
identicalrr 1554
intdvd 91
is_monomial_test 14672997
is_negative 0
isexactzero 441599501
isless_iu 22509409
isrationalzero 537727030
itop2_coprime 6814434
lexcmp 1616057
lexcmp_i 1616057
lexcmp_s_matvec 21
lexcmp_scal_matvec 357
lexcmp_scal_vecsmall 42
lexcmp_similar 371975
lexcmp_vec_mat 98
lexcmp_vecsmall_mat 42
lexcmp_vecsmall_other 196
lexcmp_vecsmall_vec 154
lexcmpgs 42
lexcmpsg 343
list_cmp 343
listcreate_gp 7
listinsert 35014
listinsert0 35028
listkill 7
listpop 21917
listpop0 56
listput 756378
listput0 705215
listsort 21
map_proto_G 462
map_proto_lG 38938904
map_proto_lGL 126
mat_test 16268
matsize 203
minval 336
mklist 6345
mklist_typ 6401
mklistcopy 56
mkmap 49
normalizepol 95053170
normalizepol_approx 0
normalizepol_lg 752262086
normalizeser 13323801
padic_to_Fl 217444
padic_to_Fp 4466
padicaff0 0
polequal 7422887
polidentical 3432196
qtop 28
quadtofp 252
r_approx0 1323372
roughtype 3232456
serequal 413
seridentical 14
sizedigit 7
u_lval 30020989
u_lvalrem 74461320
u_lvalrem_stop 274441856
u_pval 135475
u_pvalrem 2391749
vecequal 5593072
vecidentical 5244590
vecindexmax 502350
vecindexmin 168048
vecmax 66058
vecmax0 226126
vecmin 21314
vecmin0 133391
z_lval 1809323
z_lvalrem 87346
z_pval 1306539
z_pvalrem 399
zx_lval 28924

Generated by: LCOV version 1.14