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 30007-407ab607e8) Lines: 455 521 87.3 %
Date: 2025-02-20 09:19:49 Functions: 39 41 95.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
maxprime_check 0
set_optimize 0
u_forprime_restrict 63
forcomposite 70
forcomposite_init 70
maxprimeN 196
forcomposite_next 238
forprime 959
forprimestep 1085
forprime_init 1315
ZV_copy_alloc 1869
ZV_size 1869
good_arena_size 1869
initprimes 1869
initprimes0 1869
initprimes1 1869
initprimetable 1869
pari_close_primes 1869
pari_init_primes 1869
pari_sieve_init 1869
set_prodprimes 1869
forprimestep_init 2420
sieve_chunk 7161
sieve_block 9136
arith_set 101996
prodprimes 936563
prodprimeslim 936563
init_modular_small 4479394
u_forprime_sieve_init 5333129
u_forprime_set_prime_table 8033812
optimize_chunk 8456544
sieve_init 8456550
init_modular_big 10463991
u_forprime_init 17401573
u_forprime_arith_init 17992910
u_forprime_sieve_arith_init 23326330
maxprime 33368866
forprime_next 45385959
maxprimelim 72471460
shift_cache 130055020
u_forprime_next 204022369

Generated by: LCOV version 1.16