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 - language - hash.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30703-cd958ce78c) Lines: 228 250 91.2 %
Date: 2026-02-23 09:22:43 Functions: 39 40 97.5 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
eq_id 309191
fingerprint 2226
get_prime_index 56892
glue 539942815
glueb 2534
glueisb 3290
hash_GEN 141959265
hash_create 41109
hash_create_GEN 35051
hash_create_INT 259
hash_create_str 3839
hash_create_ulong 1288
hash_dbg 0
hash_destroy 3794
hash_haskey_GEN 152437
hash_haskey_long 335509
hash_id 646675
hash_init 56892
hash_init_GEN 12119
hash_init_ulong 3664
hash_insert 790118
hash_insert2 1778247
hash_insert_long 54725
hash_keys 1294
hash_keys_GEN 3901
hash_link 16475
hash_link2 1794722
hash_remove 24
hash_remove_select 3010
hash_search 1665168
hash_search2 3505357
hash_select 77
hash_values 2037
hash_values_GEN 420
hash_zv 17507
hashi 56271730
hashib 1239
hashstr_import_static 25
setlen 61781
strequal 15861

Generated by: LCOV version 1.16