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 30365-beea1ff998) Lines: 2197 2397 91.7 %
Date: 2025-07-01 09:21:48 Functions: 155 166 93.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
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
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 389
Buchall_deg1 1204
FlxqX_chinese_unit 1379
try_elt 1718
divide_p_elt 2428
bnfinit0 2618
Vbase_to_FB 3349
pr_index 3349
idealHNF_mulred 3509
needed_bitprec 3831
idealmulpowprime2 4488
makecycgen 4956
ZV_mul 7283
pr_orbit_fill 11865
makeunits 24908
subFB_change 26422
bnf_build_cycgen 26725
genback 28770
add_principal_part 32150
expandext 32173
isprincipalfact 32173
bnf_compactfu 37414
RgM_expbitprec 48790
get_regulator 48886
bnf_build_units 50731
matbotidembs 55472
matenlarge 55472
get_random_ideal 55616
rnd_rel 55616
_nfnewprec 57721
matbotid 62489
Buchall 62602
class_group_gen 64006
nthideal 64007
automorphism_perms 64008
compute_invres 64008
getfu 64008
primeneeded 64008
extract_full_lattice 64014
automorphism_matrices 64071
add_cyclotomic_units 64085
delete_cache 64085
init_rel 64085
nfcyclotomicunits 64085
reallocate 64085
diagact_arch 64105
get_clg2 64105
buchall_end 65212
Buchall_param 65220
init_famat 65756
FB_aut_perm 66262
FBgen 66262
ballvol 66262
delete_FB 66262
subFBgen 66262
small_norm 66739
assign_subFB 67021
clean_cols 93053
bad_check 96186
compute_R 96249
compute_multiple_of_R 121707
get_embs 122392
pre_allocate 122425
trim_list 122432
cleanarchunit 133868
init_GRHcheck 134654
free_GRHcheck 134658
nfsign_from_logarch 162325
isprincipal 174513
divide_p_id 185346
nf_cxlog_normalize 194924
modIm 204584
nfsign_tu 239985
nfsign_fu 241155
Fincke_Pohst_bound 265677
Fincke_Pohst_ideal 265678
bnf_get_ga 271795
bnf_get_GD 276751
bnf_build_cheapfu 285483
bnf_has_fu 285764
bad_subFB 307582
triv_gen 464583
GRHchk 496207
compute_multiple_of_R_pivot 576018
get_log_embed 723858
cache_prime_dec 920979
set_rel_alpha 946029
rel_embed 1014674
init_red_mod_units 1107781
red_mod_units 1107781
tailres 1129387
dump_gen 1225896
fact_ok 1226445
get_norm_fact 1229313
RgC_expbitprec 1234926
isprincipalarch 1234926
SPLIT_i 1250410
fixarch 1304762
Ur_ZC_mul 1390138
bnf_get_Ur 1390138
ZV_divrem 1390140
split_ideal 1390140
get_pr_lists 1390202
recover_partFB 1390202
bnf_get_vbase 1390223
bnf_get_W 1395115
isprincipalall 1406501
SPLIT 1406545
prec_arch 1408312
GRHok 1532665
bnfisprincipal0 1838848
fact_update 1978486
act_arch 2055035
add 2247851
set_fact 2250127
tailresback 2258769
add_rel 2422620
bnf_get_B 2780295
bnf_get_C 2814831
expbitprec 2838085
add_to_fact 2841630
already_known 2901888
add_rel_i 2906016
cleanarch 3064792
divide_p_quo 5271116
divide_p 5458882
addRe_modIm 6896404
get_fs 7506836
store 9191104
factorgen 16711639
can_factor 18121795
step 28025046

Generated by: LCOV version 1.16