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 30338-25bc3391a4) Lines: 161 183 88.0 %
Date: 2025-06-22 09:20:59 Functions: 33 34 97.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
hash_dbg 0
hash_remove 24
hashstr_import_static 25
hash_select 77
hash_create_INT 259
hash_create_ulong 1085
hash_keys 1091
hash_values 2030
hash_remove_select 3010
hash_init_ulong 3657
hash_destroy 3780
hash_create_str 3825
hash_keys_GEN 3894
hash_init_GEN 11692
strequal 15862
hash_link 16475
hash_zv 17507
hash_create_GEN 35002
hash_create 40843
hash_insert_long 54725
get_prime_index 56192
hash_init 56192
setlen 60872
hash_haskey_GEN 147474
eq_id 303101
hash_haskey_long 335509
hash_id 640382
hash_insert 787716
hash_search 1656480
hash_insert2 1767767
hash_link2 1784242
hash_search2 3485316
hash_GEN 138259788
glue 537688228

Generated by: LCOV version 1.16