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 - RgV.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30762-238ab8e6c0) Lines: 509 578 88.1 %
Date: 2026-03-22 09:27:12 Functions: 95 104 91.3 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
RgC_RgM_mul 0
RgC_RgV_mul 1687
RgC_Rg_add 2519476
RgC_Rg_div 4492323
RgC_Rg_mul 12044281
RgC_Rg_sub 24155
RgC_add 15770255
RgC_add_i 19034015
RgC_is_ei 644
RgC_neg 1048497
RgC_neg_i 4036626
RgC_sub 5004448
RgC_sub_i 5925004
RgM_RgC_mul 32233269
RgM_RgC_mul_FpM 28
RgM_RgC_mul_FqM 28
RgM_RgC_mul_fast 32233259
RgM_RgC_mul_i 35172112
RgM_RgV_mul 0
RgM_Rg_add 7618
RgM_Rg_add_shallow 739
RgM_Rg_div 604739
RgM_Rg_mul 1385435
RgM_Rg_sub 0
RgM_Rg_sub_shallow 317065
RgM_ZC_mul_i 1941962
RgM_ZM_mul 356413
RgM_ZM_mul_worker 1942040
RgM_add 690886
RgM_det_triangular 22848
RgM_is_QM 203
RgM_is_ZM 1362411
RgM_isdiagonal 336
RgM_isidentity 3664
RgM_isscalar 18417
RgM_liftred 12712
RgM_mul 7640659
RgM_mul_FpM 57148
RgM_mul_FpM_i 57148
RgM_mul_FqM 26005
RgM_mul_QXQM 4795
RgM_mul_ZXQM 1491
RgM_mul_fast 7624881
RgM_mul_i 4723833
RgM_multosym 0
RgM_neg 542310
RgM_powers 168
RgM_sqr 1407
RgM_sqr_QXQM 7
RgM_sqr_ZXQM 133
RgM_sqr_fast 1372
RgM_sub 174606
RgM_sumcol 400
RgM_transmul 0
RgM_transmultosym 7663
RgM_zc_mul 71981
RgM_zc_mul_i 243903
RgM_zm_mul 58187
RgMrow_RgC_mul 4795
RgMrow_RgC_mul_i 118532243
RgMrow_ZC_mul_i 32846094
RgMrow_zc_mul 70028
RgMrow_zc_mul_i 8443389
RgV_RgC_mul 5124695
RgV_RgM_mul 424902
RgV_Rg_mul 38990
RgV_add 2601847
RgV_dotproduct 1028064
RgV_dotproduct_i 15961330
RgV_dotsquare 9750181
RgV_is_ZMV 49
RgV_kill0 483805
RgV_neg 5145
RgV_prod 455004
RgV_sub 380898
RgV_sum 3187783
RgV_sumpart 0
RgV_sumpart2 0
RgV_zc_mul 83454
RgV_zc_mul_i 292592
RgV_zm_mul 58762
RgX_RgMV_eval 490
RgX_RgM_eval 1470
RgX_is_monic_ZX 4844
Rg_RgC_sub 32766
_RgM_add 3836
_RgM_cmul 5796
_RgM_mul 763
_RgM_one 4221
_RgM_red 2954
_RgM_sqr 238
_RgM_sub 0
_RgM_zero 0
_gmul 3342463
fill_scalmat 13427064
gram_matrix 4841079
isdiagonal 315
matid 9179535
scalarcol 786170
scalarcol_i 2282583
scalarcol_shallow 1496329
scalarmat 873024
scalarmat_s 217
scalarmat_shallow 3374826

Generated by: LCOV version 1.16