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 30390-1de8c4c561) Lines: 2197 2397 91.7 %
Date: 2025-07-13 09:22:39 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 1686
divide_p_elt 2387
bnfinit0 2618
Vbase_to_FB 3349
pr_index 3349
idealHNF_mulred 3506
needed_bitprec 3831
idealmulpowprime2 4488
makecycgen 4956
ZV_mul 7283
pr_orbit_fill 11865
makeunits 24908
subFB_change 26435
bnf_build_cycgen 26726
genback 28769
add_principal_part 32152
expandext 32172
isprincipalfact 32172
bnf_compactfu 37414
RgM_expbitprec 48790
get_regulator 48883
bnf_build_units 50731
matenlarge 55538
matbotidembs 55540
get_random_ideal 55690
rnd_rel 55690
_nfnewprec 57722
matbotid 62487
Buchall 62596
class_group_gen 64007
automorphism_perms 64008
compute_invres 64008
getfu 64008
nthideal 64008
primeneeded 64008
extract_full_lattice 64013
automorphism_matrices 64070
add_cyclotomic_units 64083
delete_cache 64083
init_rel 64083
nfcyclotomicunits 64083
reallocate 64083
diagact_arch 64105
get_clg2 64105
buchall_end 65212
Buchall_param 65215
init_famat 65755
FBgen 66255
FB_aut_perm 66259
ballvol 66259
delete_FB 66260
subFBgen 66260
small_norm 66734
assign_subFB 67020
clean_cols 93071
bad_check 96226
compute_R 96286
compute_multiple_of_R 121763
get_embs 122459
pre_allocate 122498
trim_list 122498
cleanarchunit 133866
init_GRHcheck 134672
free_GRHcheck 134673
nfsign_from_logarch 162317
isprincipal 174513
divide_p_id 185346
nf_cxlog_normalize 194924
modIm 204583
nfsign_tu 239982
nfsign_fu 241149
Fincke_Pohst_bound 265751
Fincke_Pohst_ideal 265751
bnf_get_ga 271795
bnf_get_GD 276751
bnf_build_cheapfu 285483
bnf_has_fu 285763
bad_subFB 307607
triv_gen 464583
GRHchk 496210
compute_multiple_of_R_pivot 577669
get_log_embed 723928
cache_prime_dec 920981
set_rel_alpha 946330
rel_embed 1014926
init_red_mod_units 1107780
red_mod_units 1107781
tailres 1129390
dump_gen 1225894
fact_ok 1226447
get_norm_fact 1229314
isprincipalarch 1234926
RgC_expbitprec 1234927
SPLIT_i 1250412
fixarch 1304769
split_ideal 1390138
bnf_get_Ur 1390141
Ur_ZC_mul 1390142
ZV_divrem 1390142
recover_partFB 1390201
get_pr_lists 1390202
bnf_get_vbase 1390221
bnf_get_W 1395114
isprincipalall 1406502
SPLIT 1406547
prec_arch 1408313
GRHok 1532713
bnfisprincipal0 1838849
fact_update 1978675
act_arch 2055036
add 2247853
set_fact 2250083
tailresback 2258778
add_rel 2422608
bnf_get_B 2780296
bnf_get_C 2814833
expbitprec 2838087
add_to_fact 2841589
already_known 2901997
add_rel_i 2906148
cleanarch 3064778
divide_p_quo 5271100
divide_p 5458829
addRe_modIm 6896384
get_fs 7507121
store 9190966
factorgen 16711640
can_factor 18121746
step 28024224

Generated by: LCOV version 1.16