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 - FpV.c (source / functions) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31042-0fbe168e69) Lines: 74.5 % 989 737
Test Date: 2026-07-23 17:04:59 Functions: 79.1 % 139 110
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
Fl_to_intmod 578850
Flc_Flv_mul 14
Flc_to_mod 28
Flm_Fl_add 51472
Flm_Fl_mul 82642
Flm_Fl_mul_OK 8691473
Flm_Fl_mul_inplace 0
Flm_Fl_mul_pre 26365931
Flm_Fl_mul_pre_i 17757100
Flm_Fl_sub 3710
Flm_Flc_mul 1086735
Flm_Flc_mul_i 97082575
Flm_Flc_mul_i_2 339526
Flm_Flc_mul_i_SMALL 84342072
Flm_Flc_mul_pre 6791
Flm_Flc_mul_pre_Flx 7686577
Flm_add 29322
Flm_center 11347
Flm_mul 14785934
Flm_mul_classical 28998261
Flm_mul_i 29006549
Flm_mul_pre 14070201
Flm_mul_sw 8288
Flm_neg 325386
Flm_powers 840
Flm_powu 51360
Flm_sqr 92727
Flm_sub 26307082
Flm_to_mod 59694
Flm_transpose 736441
Flmrow_Flc_mul_SMALL 781545485
Flmrow_Flc_mul_i 578160034
Flv_Fl_div 4706
Flv_Fl_div_inplace 0
Flv_Fl_mul 1754477
Flv_Fl_mul_inplace 0
Flv_Fl_mul_part_inplace 7984732
Flv_add 569672285
Flv_add_inplace 510800
Flv_center 164710
Flv_dotproduct 730750
Flv_dotproduct_pre 62204
Flv_dotproductspec_SMALL 9720389
Flv_dotproductspec_i 748652
Flv_neg 4110898
Flv_neg_inplace 6406
Flv_sub 242728660
Flv_sub_inplace 0
Flv_sum 3871
Flx_dotproduct 0
Flx_dotproduct_pre 9743876
FpC_FpV_mul 5881
FpC_Fp_mul 974705
FpC_add 284658
FpC_center 7079318
FpC_center_inplace 0
FpC_red 31838837
FpC_sub 965837
FpC_to_mod 105
FpM_FpC_mul 1763484
FpM_FpC_mul_FpX 1234380
FpM_FpC_mul_i 1763484
FpM_Fp_mul 768116
FpM_add 0
FpM_center 2815899
FpM_center_inplace 42
FpM_mul 2062229
FpM_powu 0
FpM_red 5714001
FpM_sub 0
FpM_to_mod 226
FpMrow_FpC_mul_i 18957120
FpMs_FpC_mul 0
FpMs_FpCs_solve 0
FpMs_FpCs_solve_safe 0
FpMs_leftkernel_elt 42
FpMs_leftkernel_elt_col 147
FpMs_structelim_back 147
FpVV_to_mod 574
FpV_FpMs_mul 68961
FpV_add 0
FpV_dotproduct 8684312
FpV_dotsquare 0
FpV_red 420
FpV_sub 0
FpV_to_mod 36488
FpXC_to_mod 84035
FpXC_to_mod_raw 0
FpXM_to_mod 0
FpXQC_to_mod 7
FpX_to_mod 1263472
FpX_to_mod_raw 997283
Fp_center_inplace 168
Fp_to_mod 5970
FqC_to_mod 28
FqC_to_mod_raw 107975
FqM_to_mod 26145
Fq_to_mod_raw 582533
ZMV_to_FlmV 4940
ZM_to_Flm 13459751
ZVV_to_FlvV 14722
ZV_to_Flv 58166579
ZV_zMs_mul 0
ZlM_gauss 0
ZpMs_ZpCs_solve 0
_F3C_center_inplace 7
_Flm_mul 21403
_Flm_one 840
_Flm_sqr 92727
_FpC_center_inplace 42
_FpM_mul 0
_FpM_sqr 0
__Flm_Flc_mul_i 101597376
__Flm_Flc_mul_i_SMALL 87520639
add_slices 33152
add_slices_ip 66304
gen_FpM_Wiedemann 147
gen_ZpM_Dixon_Wiedemann 0
gen_matid 2464
matid_F2xqM 35
matid_Flm 1443973
matid_FlxqM 56
random_Flv 41431
random_FpC 924
random_FpV 147
scalar_Flm 42
subtract_slices 58016
to_intmod 18975948
vecprow 23036
wrap_relcomb 0
wrap_relcomb_modp 0
wrap_relker 68814
zCs_to_ZC 0
zMs_ZC_mul 0
zMs_compress 0
zMs_to_ZM 0
zm_mul 2114
zm_zc_mul 6450565
zmrow_zc_mul 97688616

Generated by: LCOV version 2.0-1