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) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31042-0fbe168e69) Lines: 91.2 % 250 228
Test Date: 2026-07-23 17:04:59 Functions: 97.5 % 40 39
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
eq_id 315202
fingerprint 2261
get_prime_index 57054
glue 553237776
glueb 10549
glueisb 3325
hash_GEN 144368817
hash_create 41165
hash_create_GEN 35075
hash_create_INT 259
hash_create_str 3815
hash_create_ulong 1344
hash_dbg 0
hash_destroy 3774
hash_haskey_GEN 277831
hash_haskey_long 335446
hash_id 760366
hash_init 57054
hash_init_GEN 12207
hash_init_ulong 3682
hash_insert 847632
hash_insert2 1867633
hash_insert_long 54599
hash_keys 1350
hash_keys_GEN 3919
hash_link 16475
hash_link2 1884108
hash_remove 24
hash_remove_select 3010
hash_search 1791619
hash_search2 3663628
hash_select 77
hash_values 2027
hash_values_GEN 525
hash_zv 17507
hashi 57518623
hashib 1267
hashstr_import_static 25
setlen 61992
strequal 15862

Generated by: LCOV version 2.0-1