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 - ZX.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30759-17b423fb9b) Lines: 726 806 90.1 %
Date: 2026-03-20 09:26:27 Functions: 95 106 89.6 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
ZXV_ZX_fromdigits 0
ZXV_remi2n 0
ZXX_Z_add_shallow 0
ZX_digits 0
ZX_rescale2n 0
ZX_rescale_lt 0
Z_XpN_powu 0
_ZX_add 0
_ZX_divrem 0
_ZX_mul 0
_ZX_sqr 0
QXQM_sqr 7
ZX_div_by_X_1 21
ZXV_equal 28
zx_z_divexact 112
ZXQM_sqr 140
Xpm1_powu 434
QXQX_powers 476
RgX_check_ZXX 1022
ZXn_sqr 1575
QXQX_sqr 1904
ZXQX_sqr 1904
RgXX_to_Kronecker_var 3164
QXQX_QXQ_mul 3318
ZX_eval1 4718
QXQM_mul 4795
ZXX_sqr_Kronecker 5306
ZXX_max_lg 5369
ZXQM_mul 6286
ZM_mod2BIL_ZXQM 6426
ZXV_Z_mul 7476
ZXX_Z_mul 8883
ZXQX_ZXQ_mul 8988
QXQX_mul 13377
ZC_mod2BIL_ZXQC 14210
zx_to_ZX 20923
ZXQX_mul 22365
scalar_ZX_shallow 23051
Kronecker_to_ZXQX 24269
ZXX_evalx0 28548
ZX_rescale 36281
ZXT_remi2n 45228
ZXX_Z_divexact 56469
scalar_ZX 56562
Z_mod2BIL_ZXQ 63966
FqM_mul_Kronecker 81851
ZM_mod2BIL_FqM 81851
ZXV_dotproduct 82943
ZX_Z_add 87255
ZX_Z_add_shallow 95000
QX_sqr 95838
ZX_remi2n 105657
ZX_max_lg 107853
ZX_mulu 121184
ZXM_eval2BIL 176414
ZXM_expi 176414
ZX_Z_sub 182038
ZC_mod2BIL_FqC 305402
ZX_val 336837
RgX_check_QX 369652
ZX_Z_eval 523323
ZX_neg 599555
ZX_affine 674950
ZX_divuexact 977795
ZXC_eval2BIL 1091375
ZXC_expi 1091375
Z_mod2BIL_Fq 1199133
ZX_mod_Xnm1 1736143
Kronecker_to_ZXX 1768160
QX_ZX_rem 1832855
ZXn_mul 2603305
ZX_equal 2609306
Z_ZX_sub 2721945
RgX_check_ZX 2974208
ZXX_mul_Kronecker 3028535
QX_mul 3607454
ZX_Z_translate_basecase 3887942
ZX_Z_translate 3981711
ZX_Z_divexact 5102977
ZX_copy 5479251
ZX_eval2BIL 5555182
ZX_expi 5555182
ZX_shifti 6572994
RgXX_to_Kronecker 6660952
ZX_deriv 7931105
RgXX_to_Kronecker_spec 9996349
ZX_rem 11144168
ZX_Z_mul 14415154
ZX_sqrspec_sqri 18103878
ZX_valrem 29380158
ZX_sub 29673964
ZX_mulspec_mulii 37637880
Z_ZX_mulshiftspec 38111958
ZX_add 38482934
Z_sqrshiftspec_ZX 43648422
Z_mod2BIL_ZX 56995085
ZX_sqrspec_basecase 76966633
ZX_mul 83049471
ZX_mulspec 91512700
ZX_eval2BILspec 94668864
ZX_sqrspec 139410050
ZX_sqr 139414088
ZX_expispec 171653548
ZXX_renormalize 312925565
ZX_valspec 315217666
ZX_sqrspec_basecase_limb 317125059

Generated by: LCOV version 1.16