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 - basemath - prime.c (source / functions) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31042-0fbe168e69) Lines: 90.9 % 707 643
Test Date: 2026-07-23 17:04:59 Functions: 92.2 % 77 71
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
BLS_test 560
BPSW_isprime 1883720
BPSW_isprime_small 1903579
BPSW_psp 25327717
BPSW_psp_nosmalldiv 46711
BPSW_try_PL 1482
LucasMod 28503
MR_Jaeschke 7399
PL_certificate 3045
PL_certify 531
PL_isvalid 84
PRIMES_interval 21462
PRIMES_search 45527422
Z_isanypower_nosmalldiv 40833
_isprimePL 42
_uisprime 8818281
_uispsp 311548
addp 189
addp_union 56
addprimes 189
cert_type 98
check_ecppcert 56
check_ecppcertentry 392
cleanprimetab 21
get_disc 1154810
gisprime 13885783
gispseudoprime 14
gprimepi_lower_bound 1
gprimepi_upper_bound 1
init_MR_Jaeschke 585
is2psp 145100
is_2_prp_101 0
islucaspsp 28503
isprime 14626347
isprimePL 2982
ispseudoprime 0
ispsp 1042
iu_coprime 439031
millerrabin 28
pari_set_primetab 378548
pl831 2734
prime 280
prime_interval 147
prime_successor 56
prime_table_closest_p 97
prime_table_find_n 273
primecert 0
primecert0 84
primecertPL 3066
primecertexport 49
primecertisvalid 56
primepi 252
primepi_lower_bound 14
primepi_upper_bound 457608
primes 105
primes0 238
primes_interval 238
primes_interval_i 79
primes_interval_zv 14527
primes_upto_zv 7168
primes_zv 91
randomprime 91
randomprime0 154
removeprimes 28
rmprime 28
rmprimes 28
u_LucasMod_pre 1154810
uis2psp 0
uislucaspsp 0
uislucaspsp_pre 1154810
uisprime 51934921
uisprime_101 16487
uisprime_661 29955
uispsp 434469
uispsp_pre 8823522
uprime 0
uprimepi 8862923

Generated by: LCOV version 2.0-1