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) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30622-caa25a75db) Lines: 1235 1295 95.4 %
Date: 2026-01-22 09:18:00 Functions: 116 121 95.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
QXQ_reverse 5607
RgV_polint 224
RgV_polint_fast 224
RgXQ_reverse 189
ZC_union_shallow 182
ZM_merge_factor 30408
ZV_indexsort 3721
ZV_search 1073309
ZV_sort 63
ZV_sort_inplace 1990882
ZV_sort_shallow 1227
ZV_sort_uniq 61413
ZV_sort_uniq_shallow 39589
ZV_union_shallow 34766
ZV_union_shallow_t 34948
binomial 102717
binomial0 1845
binomial_lval 3206
binomialuu 81039
check_dy 16188
check_positive_entries 133
closurecmp 7909
cmp_Flx 310323
cmp_RgX 118512
cmp_RgX_Rg 4134
cmp_nodata 648071243
cmp_prime_ideal 669698
cmp_prime_over_p 3344000
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 5373503
gen_indexsort 817037
gen_indexsort_uniq 74965
gen_search 24027969
gen_setminus 259
gen_sort 5015991
gen_sort_inplace 40858885
gen_sort_shallow 371177
gen_sort_uniq 348828
gen_sortspec 190605595
gen_sortspec_uniq 2285756
gprec 91
gprec_w 13634593
gprec_wensure 6101886
gprec_wtrunc 4020812
gtoset 227086
inC 17357
indexlexsort 0
indexsort 196997
indexvecsort 42
init_sort 47486890
key_search 7
laplace 35
lexsort 127980
mathilbert 133
matqpascal 4109
merge_factor 691698
merge_sort_uniq 400703
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 631146
polcyclo_eval 100088
polcyclo_prime 504674
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 2069230
sort_extract 3136624
sort_factor 9327329
sort_factor_pol 1934332
sort_function 126889
stirling 301
stirling1 154
stirling2 1694
tablesearch 1141759
triv_sort 2228192
vandermondeinverse 50413
vandermondeinverseinit 76970
vec_equiv 1141
vec_reduce 22120
vecbinomial 7175008
veccmp 295015
vecsearch 126147
vecsort 2954
vecsort0 742
zv_search 13050841

Generated by: LCOV version 1.16