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 - bibli2.c (source / functions) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31042-0fbe168e69) Lines: 95.4 % 1295 1235
Test Date: 2026-07-23 17:04:59 Functions: 95.9 % 121 116
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
QXQ_reverse 6111
RgV_polint 224
RgV_polint_fast 224
RgXQ_reverse 189
ZC_union_shallow 182
ZM_merge_factor 30790
ZV_indexsort 3773
ZV_search 1074432
ZV_sort 63
ZV_sort_inplace 1991692
ZV_sort_shallow 1288
ZV_sort_uniq 66248
ZV_sort_uniq_shallow 39850
ZV_union_shallow 39354
ZV_union_shallow_t 39536
binomial 74592
binomial0 1855
binomial_lval 3206
binomialuu 63139
check_dy 16188
check_positive_entries 133
closurecmp 7909
cmp_Flx 326390
cmp_RgX 130371
cmp_RgX_Rg 4661
cmp_nodata 649770642
cmp_prime_ideal 705492
cmp_prime_over_p 3477958
cmp_small 77
convol 14
dirdiv 434322
dirmul 441
dirval 869526
err_hermite 21
err_lag 21
err_reverse 7
eulerianpol 77
gen_cmp_RgX 5652934
gen_indexsort 859980
gen_indexsort_uniq 76271
gen_search 24034171
gen_setminus 259
gen_sort 5144098
gen_sort_inplace 40890012
gen_sort_shallow 424249
gen_sort_uniq 353892
gen_sortspec 191727987
gen_sortspec_uniq 2292965
gprec 91
gprec_w 19822603
gprec_wensure 6842542
gprec_wtrunc 5824449
gtoset 227122
inC 17357
indexlexsort 0
indexsort 205791
indexvecsort 42
init_sort 47748530
key_search 7
laplace 35
lexsort 127981
mathilbert 133
matqpascal 5061
merge_factor 692080
merge_sort_uniq 455057
modreverse 28
polchebyshev 4284
polchebyshev1 2156
polchebyshev1_eval 14
polchebyshev1_eval_aux 70
polchebyshev2 2135
polchebyshev2_eval 35
polchebyshev2_eval_aux 91
polchebyshev_eval 4333
polcyclo 614587
polcyclo_eval 100294
polcyclo_prime 487804
polhermite 1442
polhermite_eval 0
polhermite_eval0 1477
polint 329
polint_i 329
polintspec 16223
pollaguerre 2128
pollaguerre_eval 0
pollaguerre_eval0 2163
pollaplace 14
pollegendre 2163
pollegendre_eval 0
pollegendre_eval0 2177
pollegendre_reduced 0
polrecip 161
serlaplace 14
setbinop 21
setdelta 14
setintersect 7
setisset 14
setminus 259
setsearch 536431
setunion 7
setunion_i 7
sort 2098490
sort_extract 3237340
sort_factor 9949266
sort_factor_pol 2017050
sort_function 128989
stirling 301
stirling1 154
stirling2 1694
tablesearch 1148558
triv_sort 2260643
vandermondeinverse 54838
vandermondeinverseinit 85729
vec_equiv 1141
vec_reduce 23044
vecbinomial 7190588
veccmp 295015
vecsearch 128247
vecsort 2954
vecsort0 742
zv_search 13164210

Generated by: LCOV version 2.0-1