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) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30702-bddb8d6928) Lines: 944 1220 77.4 %
Date: 2026-02-23 02:23:56 Functions: 114 134 85.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by 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_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 7
FqXC_to_mod 12
FpXQX_resultant_basecase 22
FpXQX_disc 29
FpXQXQ_minpoly 38
FpXQX_halfgcd 38
polxn_FpXX 38
random_FpXQX 45
FpXQX_resultant 49
FpXQX_powu 54
FpXQXQ_transmul_init 76
FpXQX_halfgcd_all 94
FpXQX_halfgcd_all_i 94
ZXX_copy 108
_FpXQXQ_zero 115
FpXQXM_mul2 126
FpXQX_FpXQXM_qmul 126
FpXY_FpXQ_evalx 132
FpXQXn_expint 155
FpXYQQ_pow 156
FpXQXV_FpXQX_fromdigits 162
FpXYQQ_mul 168
FpXQX_halfres_split 171
FpXQXQ_transmul 173
FpXQX_recipspec 214
FpXQX_halfres_basecase 220
FpXYQQ_sqr 240
FpXQXQ_autpow_mul 281
FpXQXM_FpXQX_mul2 297
get_FpXQXQ_algebra 306
FpXQX_dotproduct 344
FpXQX_halfres_i 391
FpXYQQ_redswap 408
FpXQXQ_autpow 427
FpXQXQ_autpow_sqr 439
FpXQX_to_mod 448
FpXQX_invBarrett_Newton 461
FpXQX_digits 534
FpXQX_addmulmul 594
FpXQXn_div 612
FpXQXn_inv 612
ZlXQXn_expint 612
FpXX_integXn 662
FpXQX_FpXQXQ_eval 740
FpXQXQ_autsum 1033
FpXQXQ_autsum_sqr 1045
FpXQXQ_autsum_mul 1154
_FpXQX_sqr 1482
FpXQXQ_powers 1612
FpXQXQ_pow 1614
FpXX_neg 1783
to_intmod 1872
FpXX_halve 1920
ZlXX_integXn 2316
FpXQX_invBarrett_basecase 2498
FpXQX_invBarrett 2977
FpXY_FpXQV_evalx 3160
FpXQX_gcd_basecase 3338
FpXQX_FpXQXQV_eval 3448
_FpXQX_sub 3999
FpXQXn_mulhigh 4020
FpXX_mulu 6108
FpXQX_mulhigh_i 6336
FpXXn_red 7200
_FpXQX_divrem 8532
FpXQX_get_red 10622
FpXX_deriv 11507
FpXY_eval 11706
FpXQX_gcd 12385
FpXY_FpY_mulspec 13087
FpXQXV_prod 14306
FpXY_evaly 16114
_FpXQXQ_one 16180
FpXX_shift 16609
_FpXQXQ_red 19755
FpXX_sub 26032
Fq_addmul 30668
FpXX_red 34054
FpXQXn_mul 38189
_FpXQXQ_mul 39550
FpXQXQ_mul 42287
to_ZX 42606
FpXY_evalx 43878
FpXX_Fp_mul 48410
FpXQX_div_by_X_x 57886
FpXQX_divrem_Barrett 70677
_FpXQX_mul 95657
_FpXQX_add 104485
FpXX_FpX_mul 107651
_FpXQXQ_cmul 107671
FpXQX_extgcd 113125
FpXX_FpX_mulspec 120738
FpXX_subspec 128057
FpXQX_divrem_Barrettspec 128891
FpXQX_divrem_basecase 149238
FpXQXQ_sqr 149405
_FpXQXQ_sqr 149405
FpXQX_sqr 158446
ZXX_is_ZX 209307
FpXQX_rem 224515
FpXX_recipspec 257782
ZXX_lgrenormalizespec 266710
FpXX_add 382232
FpXQX_FpXQ_mul 471207
FpXQX_divrem 909486
to_FlxqX 1061016
get_FpXQX_red 1134077
FpXQX_mul 1172852
FpXQX_mulspec 1435752
Kronecker_to_FpXQX 1600091
FpXQX_red 1645059
ZXX_is_ZX_spec 3080811

Generated by: LCOV version 1.16