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 - buch1.c (source / functions) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31041-bd73e9fcdd) Lines: 95.5 % 711 679
Test Date: 2026-07-22 22:45:42 Functions: 92.9 % 56 52
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
GRH_last_prime 0
buchimag 0
buchreal 0
dbg_all 0
imag_be_honest 7
real_be_honest 7
mpqs_relations 336
bnf_increase_LIMC 2357
qfr3_canon_safe 3710
Buchquad 4424
quadclassunit0 4424
quadclassnos 5032
real_relations 5145
rel_to_col 8813
isless_iu 10416
gcdreal 33978
crabs 55146
quadclassno 113132
quad_be_honest 122364
get_clgp 122378
nthidealquad 122378
compute_invresquad 122390
trivial_relations 122392
subFBquad 122484
FBquad 122487
Buchquad_i 122592
sub_fact 149964
qfr3_pf 159390
get_R 159985
qfr3_random 161567
powsubFBquad 172082
imag_relations 175936
dist 184688
dist_set 184688
qfr5_factorback 197015
qfr5_pf 217588
qfr5_rho_pow 220157
qfi_factorback 264078
clearhash 294539
GRH_ensure 454948
is_bad 689066
QFR3_comp 1007545
qfr3_canon 1166963
QFR5_comp 1735160
quadGRHchk 1808974
qfr5_canon 1952748
cache_prime_quad 2053814
add_fact 3105896
largeprime 3471460
hash 3471516
qfi_random 5506585
random_form 5668174
init_form 6130078
Z_isquasismooth_prod 7093744
factorquad 7100591
QFI_comp 16471798

Generated by: LCOV version 2.0-1