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 - ZV.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30764-6b81f1f3fa) Lines: 839 988 84.9 %
Date: 2026-03-26 09:27:02 Functions: 131 149 87.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Flc_lincomb1_inplace 29897002
QM_QC_mul 125448
QM_mul 558714
QM_sqr 700
RgM_check_ZM 598556
RgM_issquare 42
RgV_check_ZV 1501284
ZC_Q_mul 2756533
ZC_ZV_mul 0
ZC_Z_add 370252
ZC_Z_div 3676862
ZC_Z_divexact 5876321
ZC_Z_mul 36184179
ZC_Z_sub 0
ZC_add 27095158
ZC_add_i 37125339
ZC_copy 18808696
ZC_divexactu 2261
ZC_hnfdivrem 10697081
ZC_hnfdivrem_i 11402914
ZC_is_ei 174398
ZC_lincomb 34911239
ZC_lincomb1 16044750
ZC_lincomb1_inplace 65759597
ZC_lincomb1_inplace_i 76823486
ZC_lincomb_1 760190
ZC_modhnf 280
ZC_neg 6363945
ZC_reducemodlll 97986
ZC_reducemodmatrix 112292
ZC_reducemodmatrix_i 112293
ZC_sub 9157027
ZC_sub_i 9573215
ZC_z_mul 64370
ZMV_to_zmV 49
ZM_Q_mul 1140895
ZM_ZC_mul 25800902
ZM_ZC_mul_i 78993847
ZM_ZV_divrem 0
ZM_Z_div 19308
ZM_Z_divexact 530679
ZM_Z_mul 3382047
ZM_add 844687
ZM_copy 743973
ZM_det_triangular 4267422
ZM_diag_mul 592973
ZM_divexactu 441
ZM_equal 3500257
ZM_equal0 32306
ZM_hnfdivrem 529491
ZM_hnfdivrem_i 529506
ZM_isdiagonal 677197
ZM_ishnf 878296
ZM_isidentity 658206
ZM_isscalar 161792
ZM_max_expi 0
ZM_max_expi_i 0
ZM_max_lg 22655
ZM_max_lg_i 27921049
ZM_modhnf 14
ZM_mul 21115383
ZM_mul_classical 13884367
ZM_mul_diag 21
ZM_mul_fast 839
ZM_mul_i 21512351
ZM_mul_slice 1105
ZM_mul_sw 76372
ZM_mul_worker 1105
ZM_multosym 0
ZM_nc_mul_i 0
ZM_neg 1733954
ZM_nm_mul 0
ZM_pow 0
ZM_powu 23618
ZM_reducemodlll 0
ZM_reducemodmatrix 239854
ZM_reducemodmatrix_i 239854
ZM_sqr 25221
ZM_sqr_fast 0
ZM_sqr_i 25221
ZM_sqr_slice 0
ZM_sqr_worker 0
ZM_sub 181692
ZM_supnorm 4260
ZM_to_zm 1022
ZM_togglesign 0
ZM_transmul 2289
ZM_transmultosym 532221
ZM_zc_mul 17959382
ZM_zc_mul_i 20111614
ZM_zm_mul 1001665
ZMrow_ZC_mul 137973602
ZMrow_ZC_mul_i 604470594
ZMrow_equal0 16231
ZRED 1170575
ZV_ZM_mul 231238
ZV_ZV_divrem 7
ZV_abscmp 19747
ZV_cmp 3254400
ZV_content 300477
ZV_dotproduct 16644789
ZV_dotproduct_i 19474058
ZV_dotsquare 6861590
ZV_equal 293364
ZV_equal0 15014001
ZV_equal_lg 6518921
ZV_max_expi 0
ZV_max_expi_i 0
ZV_max_lg 10640
ZV_max_lg_i 114372726
ZV_neg_inplace 391119
ZV_prod 8856052
ZV_sum 77
ZV_to_nv 431560
ZV_togglesign 7278263
ZV_zc_mul 2229556
Z_ZC_sub 584315
ZincrementalGS 1279229
Zupdate_row 402266
_ZM_mul 280
_ZM_sqr 24143
_mulii 319095196
add_slices 610976
check_ZV 1938992
matmodhnf 49
matmodhnf_check 98
nm_Z_mul 0
subtract_slices 534604
sw_bound 13960740
vecsmall_prod 14694393
zmV_to_ZMV 126
zm_to_Flm 22694
zm_to_ZM 183763
zvV_equal 1638
zv_ZM_mul 2408
zv_abs 77
zv_canon_inplace 22921521
zv_content 19545158
zv_dotproduct 196399119
zv_equal 30999373
zv_equal0 23113596
zv_neg 51879
zv_neg_inplace 126
zv_prod 951613
zv_prod_Z 1974527
zv_sum 16508
zv_sumpart 0
zv_to_Flv 366646
zv_z_mul 28767

Generated by: LCOV version 1.16