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 31041-bd73e9fcdd) Lines: 76.8 % 1229 944
Test Date: 2026-07-22 22:45:42 Functions: 84.4 % 135 114
Legend: Lines:     hit not hit

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

Generated by: LCOV version 2.0-1