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 - bb_hnf.c (source / functions) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31053-95e3b72995) Lines: 96.8 % 664 643
Test Date: 2026-07-24 17:03:07 Functions: 96.4 % 55 53
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
Z_split 28
Z_stab 28
_Fp_add 40658628
_Fp_equal0 108210040
_Fp_equal1 30830798
_Fp_extgcd 3894758
_Fp_lquo 2393394
_Fp_mul 48438008
_Fp_neg 5040061
_Fp_rann 2405905
_Fp_red 49964595
_Fp_s 16038920
_Fp_unit 7576575
gaussmodulo 0
gaussmodulo2 0
gaussmoduloall 77
gen_addcol 5915990
gen_addrightmul 4467972
gen_colei 371469
gen_detops 42
gen_elem 3983595
gen_howell 101780
gen_howell_i 1070535
gen_inv 712660
gen_is_inv 220794
gen_is_zerocol 4727316
gen_kernel 56154
gen_kernel_from_howell 100009
gen_kernel_howell 99932
gen_last_inv_diago 201712
gen_leftapply 15435167
gen_matid_hermite 56091
gen_matimage 157794
gen_matmul_hermite 2714850
gen_redcol 18793772
gen_reduce_mod_howell 43953
gen_rightapply 374465
gen_rightlincomb 7967190
gen_rightmulcol 20964296
gen_solve 43953
gen_solve_from_howell 43953
gen_zerocol 3374580
gen_zeromat 1803817
get_Fp_hermite 970603
matdetmod 84
matimagemod 157829
matinvmod 799040
matkermod 56189
matsolvemod 44156
matsolvemod_finite 43953
mkopU 977638
mkopmul 2183204
mkopswap 45843
mkoptransv 3217237
msolvemod0 77

Generated by: LCOV version 2.0-1