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 30556-bb9f5f8fc8) Lines: 2215 2530 87.5 %
Date: 2025-11-25 09:20:50 Functions: 159 176 90.3 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fincke_Pohst_ideal_par 0
bnfinit_FP_worker 0
bnrnewprec_shallow 0
dbg_newrel 0
err_units 0
expand 0
i2print 0
inv_fact 0
isprincipalfact_or_fail 0
isprincipalforce 0
isprincipalgen 0
isprincipalgenforce 0
pack_FB 0
rnd_rel_par 0
small_norm_par 0
unpack_FB 0
wr_rel 0
be_honest 7
bnfnewprec 7
bnrnewprec 7
signunits 7
bnf_build_matalpha 20
makematal 20
nfsign_units 35
get_archclean 40
bnftestprimes 63
get_norm_fact_primes 69
get_y 69
bnf_compactfu_mat 70
myprecdbl 73
SUnits_archclean 77
chinese_unit 94
log2Mbound 94
log2fubound 94
vec_chinese_units 94
bnfnewprec_shallow 97
RgV_is1 105
ZM_remove_unused 164
chinese_unit_slice 274
chinese_unit_worker 274
not_given 396
Buchall_deg1 1162
FlxqX_chinese_unit 1379
try_elt 1610
divide_p_elt 2341
bnfinit0 2632
Vbase_to_FB 3349
pr_index 3349
idealHNF_mulred 3500
needed_bitprec 3849
idealmulpowprime2 4488
makecycgen 4928
ZV_mul 7283
pr_orbit_fill 11865
makeunits 24915
subFB_change 25194
bnf_build_cycgen 26698
genback 28343
add_principal_part 32173
expandext 32194
isprincipalfact 32194
bnf_compactfu 37330
RgM_expbitprec 48272
get_regulator 48369
bnf_build_units 50738
get_random_ideal 53515
rnd_rel 53515
rnd_rel_seq 53515
matbotidembs 54160
matenlarge 54160
_nfnewprec 56742
matbotid 61503
Buchall 61562
getfu 63033
class_group_gen 63034
automorphism_perms 63035
compute_invres 63035
nthideal 63035
primeneeded 63035
small_norm_prec 63035
extract_full_lattice 63042
automorphism_matrices 63098
add_cyclotomic_units 63106
delete_cache 63106
init_rel 63106
nfcyclotomicunits 63106
reallocate 63106
diagact_arch 63132
get_clg2 63132
Buchall_param 64195
buchall_end 64197
init_famat 64783
ballvol 65196
FBgen 65197
subFBgen 65197
delete_FB 65198
FB_aut_perm 65199
assign_subFB 65904
small_norm 66556
small_norm_seq 66556
clean_cols 91665
bad_check 94106
compute_R 94169
compute_multiple_of_R 119446
get_embs 120102
pre_allocate 120142
trim_list 120142
cleanarchunit 132170
init_GRHcheck 133699
free_GRHcheck 133700
nfsign_from_logarch 162273
isprincipal 174513
divide_p_id 185076
nf_cxlog_normalize 197126
modIm 202278
nfsign_tu 238881
nfsign_fu 240028
Fincke_Pohst_bound 262299
Fincke_Pohst_ideal 262304
Fincke_Pohst_ideal_both 262304
bnf_get_ga 270133
bnf_get_GD 275061
bnf_build_cheapfu 284285
bnf_has_fu 284572
bad_subFB 301990
triv_gen 464562
GRHchk 489899
compute_multiple_of_R_pivot 566036
get_log_embed 718726
cache_prime_dec 908397
set_rel_alpha 935011
rel_embed 1003485
init_red_mod_units 1107554
red_mod_units 1107554
tailres 1112511
dump_gen 1226128
fact_ok 1226649
get_norm_fact 1229565
RgC_expbitprec 1235144
isprincipalarch 1235149
SPLIT_i 1250897
fixarch 1304265
split_ideal 1390370
Ur_ZC_mul 1390374
ZV_divrem 1390374
bnf_get_Ur 1390374
get_pr_lists 1390433
recover_partFB 1390433
bnf_get_vbase 1390453
bnf_get_W 1395317
isprincipalall 1406754
SPLIT 1406779
prec_arch 1408521
GRHok 1526404
bnfisprincipal0 1839060
fact_update 1975105
act_arch 2047739
tailresback 2225021
set_fact 2234320
add 2242882
add_rel 2404547
bnf_get_B 2780763
bnf_get_C 2815293
add_to_fact 2825616
expbitprec 2835322
already_known 2876192
add_rel_i 2880178
cleanarch 3062780
divide_p_quo 5272999
divide_p 5460410
addRe_modIm 6890576
get_fs 7419008
store 9177727
factorgen 16782153
can_factor 18192424
step 28102912

Generated by: LCOV version 1.16