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 30640-c2c58e18c5) Lines: 2218 2538 87.4 %
Date: 2026-01-27 08:51:18 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 1144
try_elt 1331
FlxqX_chinese_unit 1379
divide_p_elt 1915
bnfinit0 2639
Vbase_to_FB 3426
pr_index 3426
idealHNF_mulred 3466
makecycgen 3835
needed_bitprec 3857
idealmulpowprime2 4761
ZV_mul 7332
bnf_compactfu 10819
pr_orbit_fill 11865
bnf_build_cycgen 16443
subFB_change 20139
genback 24832
makeunits 24922
add_principal_part 31873
expandext 31894
isprincipalfact 31894
matbotidembs 36936
matenlarge 36936
RgM_expbitprec 39317
get_regulator 39414
get_random_ideal 43249
rnd_rel 43249
rnd_rel_seq 43249
_nfnewprec 46764
small_norm 49630
small_norm_seq 49630
matbotid 50547
Buchall 50602
bnf_build_units 50745
getfu 52085
class_group_gen 52086
small_norm_prec 52088
automorphism_perms 52090
compute_invres 52090
nthideal 52090
primeneeded 52090
extract_full_lattice 52092
delete_cache 52139
add_cyclotomic_units 52143
init_rel 52143
nfcyclotomicunits 52143
reallocate 52143
automorphism_matrices 52152
diagact_arch 52182
get_clg2 52182
buchall_end 53230
Buchall_param 53243
delete_FB 53758
FBgen 53761
FB_aut_perm 53762
ballvol 53762
subFBgen 53762
init_famat 53889
assign_subFB 54342
clean_cols 67351
bad_check 75630
compute_R 75692
nfsign_from_logarch 88343
compute_multiple_of_R 91490
get_embs 92041
pre_allocate 92931
trim_list 92931
nfsign_tu 102886
nfsign_fu 104059
cleanarchunit 109595
bnf_build_cheapfu 121831
bnf_has_fu 122118
free_GRHcheck 122519
init_GRHcheck 122520
divide_p_id 158434
modIm 171596
isprincipal 174467
nf_cxlog_normalize 197126
Fincke_Pohst_bound 220333
Fincke_Pohst_ideal 220335
Fincke_Pohst_ideal_both 220335
bad_subFB 249870
bnf_get_ga 264365
bnf_get_GD 268200
GRHchk 410075
triv_gen 459087
compute_multiple_of_R_pivot 467470
get_log_embed 618147
cache_prime_dec 748246
set_rel_alpha 773464
rel_embed 841284
tailres 921160
init_red_mod_units 1087860
red_mod_units 1087860
fact_ok 1160624
dump_gen 1161172
get_norm_fact 1164615
RgC_expbitprec 1169179
isprincipalarch 1169179
SPLIT_i 1212431
fixarch 1226673
Ur_ZC_mul 1325371
ZV_divrem 1325371
bnf_get_Ur 1325371
split_ideal 1325371
get_pr_lists 1325434
recover_partFB 1325434
bnf_get_vbase 1325454
bnf_get_W 1329226
isprincipalall 1341307
SPLIT 1341779
prec_arch 1342921
GRHok 1444512
bnfisprincipal0 1768438
tailresback 1842313
act_arch 1927773
fact_update 2026441
set_fact 2075745
add 2131046
add_rel 2220020
already_known 2597383
add_rel_i 2600148
bnf_get_B 2650761
add_to_fact 2661973
bnf_get_C 2684248
expbitprec 2716464
cleanarch 2907215
divide_p_quo 5200793
divide_p 5361134
get_fs 6356941
addRe_modIm 6625081
store 8913270
factorgen 16966488
can_factor 18311671
step 28336074

Generated by: LCOV version 1.16