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 - buch2.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30702-bddb8d6928) Lines: 2195 2538 86.5 %
Date: 2026-02-23 02:23:56 Functions: 159 176 90.3 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Buchall 53522
Buchall_deg1 1017
Buchall_param 55702
FB_aut_perm 56590
FBgen 56590
Fincke_Pohst_bound 227915
Fincke_Pohst_ideal 227915
Fincke_Pohst_ideal_both 227915
Fincke_Pohst_ideal_par 0
FlxqX_chinese_unit 1097
GRHchk 423748
GRHok 1164549
RgC_expbitprec 1038851
RgM_expbitprec 41668
RgV_is1 90
SPLIT 1185423
SPLIT_i 1052559
SUnits_archclean 56
Ur_ZC_mul 1172043
Vbase_to_FB 2936
ZM_remove_unused 134
ZV_divrem 1172043
ZV_mul 5787
_nfnewprec 49354
act_arch 1707240
add 1858495
addRe_modIm 5788180
add_cyclotomic_units 54744
add_principal_part 26843
add_rel 2106297
add_rel_i 2516868
add_to_fact 2470747
already_known 2513338
assign_subFB 57245
automorphism_matrices 54723
automorphism_perms 54674
bad_check 82301
bad_subFB 263306
ballvol 56590
be_honest 6
bnf_build_cheapfu 244210
bnf_build_cycgen 22511
bnf_build_matalpha 17
bnf_build_units 43413
bnf_compactfu 32033
bnf_compactfu_mat 60
bnf_get_B 2344103
bnf_get_C 2372588
bnf_get_GD 220328
bnf_get_Ur 1172043
bnf_get_W 1176214
bnf_get_ga 216174
bnf_get_vbase 1172109
bnf_has_fu 244456
bnfinit0 2180
bnfinit_FP_worker 0
bnfisprincipal0 1556180
bnfnewprec 6
bnfnewprec_shallow 73
bnftestprimes 49
bnrnewprec 6
bnrnewprec_shallow 0
buchall_end 55691
cache_prime_dec 786461
can_factor 15762956
chinese_unit 74
chinese_unit_slice 218
chinese_unit_worker 218
class_group_gen 54674
clean_cols 79491
cleanarch 2585862
cleanarchunit 114284
compute_R 82355
compute_invres 54674
compute_multiple_of_R 104052
compute_multiple_of_R_pivot 487490
dbg_newrel 0
delete_FB 56590
delete_cache 54744
diagact_arch 54747
divide_p 4771564
divide_p_elt 2131
divide_p_id 157893
divide_p_quo 4611540
dump_gen 1031203
err_units 0
expand 0
expandext 26861
expbitprec 2373824
extract_full_lattice 54680
fact_ok 1032044
fact_update 1790025
factorgen 14574250
fixarch 1098449
free_GRHcheck 105262
genback 24526
get_archclean 34
get_clg2 54747
get_embs 104612
get_fs 6411883
get_log_embed 619106
get_norm_fact 1034115
get_norm_fact_primes 58
get_pr_lists 1172092
get_random_ideal 48350
get_regulator 41741
get_y 58
getfu 54674
i2print 0
idealHNF_mulred 2982
idealmulpowprime2 4080
init_GRHcheck 105262
init_famat 56220
init_red_mod_units 928057
init_rel 54744
inv_fact 0
isprincipal 149510
isprincipalall 1185540
isprincipalarch 1038851
isprincipalfact 26861
isprincipalfact_or_fail 0
isprincipalforce 0
isprincipalgen 0
isprincipalgenforce 0
log2Mbound 74
log2fubound 74
makecycgen 4154
makematal 17
makeunits 21320
matbotid 53430
matbotidembs 47414
matenlarge 47414
modIm 174384
myprecdbl 63
needed_bitprec 3266
nf_cxlog_normalize 168985
nfcyclotomicunits 54744
nfsign_from_logarch 138494
nfsign_fu 206252
nfsign_tu 205247
nfsign_units 30
not_given 333
nthideal 54674
pack_FB 0
pr_index 2936
pr_orbit_fill 10170
pre_allocate 105376
prec_arch 1187031
primeneeded 54674
reallocate 54744
recover_partFB 1172092
red_mod_units 928057
rel_embed 866553
rnd_rel 48350
rnd_rel_par 0
rnd_rel_seq 48350
set_fact 1958835
set_rel_alpha 808397
signunits 6
small_norm 56956
small_norm_par 0
small_norm_prec 54674
small_norm_seq 56956
split_ideal 1172043
step 24570232
store 8015250
subFB_change 22840
subFBgen 56590
tailres 964647
tailresback 1929294
trim_list 105376
triv_gen 397544
try_elt 1530
unpack_FB 0
vec_chinese_units 74
wr_rel 0

Generated by: LCOV version 1.16