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 - forprime.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30571-c0dfe82732) Lines: 454 520 87.3 %
Date: 2025-12-11 09:22:11 Functions: 39 41 95.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
ZV_copy_alloc 1890
ZV_size 1890
arith_set 102080
forcomposite 70
forcomposite_init 70
forcomposite_next 238
forprime 973
forprime_init 1315
forprime_next 45413581
forprimestep 1099
forprimestep_init 2434
good_arena_size 1890
init_modular_big 12061640
init_modular_small 4604567
initprimes 1890
initprimes0 1890
initprimes1 1890
initprimetable 1890
maxprime 36223395
maxprimeN 196
maxprime_check 0
maxprimelim 76112369
optimize_chunk 9071438
pari_close_primes 1890
pari_init_primes 1890
pari_sieve_init 1890
prodprimes 1043155
prodprimeslim 1043155
set_optimize 0
set_prodprimes 1890
shift_cache 130466035
sieve_block 9170
sieve_chunk 7242
sieve_init 9071438
u_forprime_arith_init 19948773
u_forprime_init 19340390
u_forprime_next 206830131
u_forprime_restrict 63
u_forprime_set_prime_table 8623547
u_forprime_sieve_arith_init 25620201
u_forprime_sieve_init 5671049

Generated by: LCOV version 1.16