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 - FpXX.c (source / functions) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31042-0fbe168e69) Lines: 76.8 % 1229 944
Test Date: 2026-07-23 17:04:59 Functions: 84.4 % 135 114
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
FpXQXM_FpXQX_mul2 376
FpXQXM_mul2 161
FpXQXQ_autpow 493
FpXQXQ_autpow_mul 325
FpXQXQ_autpow_sqr 507
FpXQXQ_autsum 1184
FpXQXQ_autsum_mul 1316
FpXQXQ_autsum_sqr 1198
FpXQXQ_auttrace 8
FpXQXQ_auttrace_mul 1
FpXQXQ_auttrace_sqr 1
FpXQXQ_div 0
FpXQXQ_inv 0
FpXQXQ_invsafe 0
FpXQXQ_matrix_pow 0
FpXQXQ_minpoly 44
FpXQXQ_mul 48020
FpXQXQ_pow 1859
FpXQXQ_powers 1848
FpXQXQ_sqr 170827
FpXQXQ_transmul 200
FpXQXQ_transmul_init 88
FpXQXT_red 0
FpXQXV_FpXQX_fromdigits 189
FpXQXV_prod 16716
FpXQXV_red 0
FpXQX_FpXQXM_qmul 161
FpXQX_FpXQXQV_eval 3957
FpXQX_FpXQXQ_eval 855
FpXQX_FpXQ_mul 550853
FpXQX_addmulmul 752
FpXQX_digits 623
FpXQX_disc 35
FpXQX_div_by_X_x 69699
FpXQX_divrem 1077825
FpXQX_divrem_Barrett 82290
FpXQX_divrem_Barrettspec 150350
FpXQX_divrem_basecase 172542
FpXQX_dotproduct 396
FpXQX_extgcd 134218
FpXQX_extgcd_basecase 0
FpXQX_extgcd_halfgcd 0
FpXQX_gcd 14664
FpXQX_gcd_basecase 3870
FpXQX_get_red 12167
FpXQX_halfgcd 44
FpXQX_halfgcd_all 114
FpXQX_halfgcd_all_i 114
FpXQX_halfres 0
FpXQX_halfres_basecase 275
FpXQX_halfres_i 490
FpXQX_halfres_split 215
FpXQX_halfres_update 0
FpXQX_invBarrett 3529
FpXQX_invBarrett_Newton 537
FpXQX_invBarrett_basecase 2971
FpXQX_mul 1350155
FpXQX_mulhigh_i 6881
FpXQX_mulspec 1656816
FpXQX_powu 56
FpXQX_recipspec 248
FpXQX_red 1927223
FpXQX_rem 256615
FpXQX_resultant 63
FpXQX_resultant_basecase 28
FpXQX_sqr 180858
FpXQX_to_mod 532
FpXQX_to_mod_raw 0
FpXQXn_div 658
FpXQXn_exp 0
FpXQXn_expint 178
FpXQXn_inv 658
FpXQXn_mul 41367
FpXQXn_mulhigh 4368
FpXQXn_sqr 0
FpXX_FpX_mul 125115
FpXX_FpX_mulspec 140194
FpXX_Fp_mul 56546
FpXX_Fp_sub 0
FpXX_add 441507
FpXX_deriv 12978
FpXX_halve 2079
FpXX_integ 0
FpXX_integXn 763
FpXX_mulu 7074
FpXX_neg 2017
FpXX_recipspec 300700
FpXX_red 40693
FpXX_shift 18279
FpXX_sub 29848
FpXX_subspec 149377
FpXXn_red 7861
FpXYQQ_mul 196
FpXYQQ_pow 182
FpXYQQ_redswap 476
FpXYQQ_sqr 280
FpXY_FpXQV_evalx 3618
FpXY_FpXQ_evalx 154
FpXY_FpY_mulspec 15079
FpXY_eval 13657
FpXY_evalx 51513
FpXY_evaly 18799
FqXC_to_mod 14
FqXC_to_mod_raw 0
FqXM_to_mod 0
FqX_to_mod_raw 0
Fq_addmul 35602
Kronecker_to_FpXQX 1842875
ZXX_copy 126
ZXX_is_ZX 235889
ZXX_is_ZX_spec 3549521
ZXX_lgrenormalizespec 311101
ZlXQXn_expint 658
ZlXX_integXn 2513
_FpXQXQ_cmul 125138
_FpXQXQ_mul 44890
_FpXQXQ_one 18647
_FpXQXQ_red 19370
_FpXQXQ_sqr 170827
_FpXQXQ_zero 125
_FpXQX_add 121495
_FpXQX_divrem 9954
_FpXQX_mul 118634
_FpXQX_sqr 1729
_FpXQX_sub 4491
get_FpXQXQ_algebra 331
get_FpXQX_algebra 0
get_FpXQX_red 1334528
matJ2_FpXQXM 0
matid2_FpXQXM 0
polxn_FpXX 44
random_FpXQX 52
to_FlxqX 1256078
to_ZX 51968
to_intmod 2191

Generated by: LCOV version 2.0-1