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 - bit.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30813-28f64e5615) Lines: 430 444 96.8 %
Date: 2026-04-14 09:26:12 Functions: 36 38 94.7 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
bits_to_int 0
bits_to_u 0
hamming_mat 7
hamming_int 21
int_set_ulong 24
ibittrunc 35
bittest 91
gbittest 91
ibitor 105
gbitneg 112
ibitxor 147
gbitnegimply 196
gbitor 196
gbitxor 196
ibitnegimply 203
bitset 210
bitclear 546
inegate 630
bitflip 721
hamming_slice 882
hamming_vecsmall 889
hammingweight 1806
fromdigits_2k 28014
F2v_to_ZV_inplace 28042
binaire 28077
binary_zv 35238
int_set_int 192763
binary_2k_nv 5649885
binary_2k 5697775
nv_fromdigits_2k 17568648
ibitand 37267461
gbitand 37267524
signs 37267916
checkint2 37268112
int_get_int 232235818
int_get_ulong 316128833
int_set_bits 801621238
int_get_bits 848806749

Generated by: LCOV version 1.16