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 30418-83092bf331) Lines: 2197 2397 91.7 %
Date: 2025-07-29 09:22:49 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 1667
divide_p_elt 2373
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 24907
subFB_change 26378
bnf_build_cycgen 26726
genback 28770
add_principal_part 32173
expandext 32191
isprincipalfact 32193
bnf_compactfu 37413
RgM_expbitprec 48790
get_regulator 48885
bnf_build_units 50730
matbotidembs 55420
matenlarge 55422
get_random_ideal 55572
rnd_rel 55572
_nfnewprec 57721
matbotid 62486
Buchall 62601
getfu 64006
automorphism_perms 64008
class_group_gen 64008
compute_invres 64008
nthideal 64008
primeneeded 64008
extract_full_lattice 64015
automorphism_matrices 64070
add_cyclotomic_units 64082
delete_cache 64082
init_rel 64082
nfcyclotomicunits 64082
reallocate 64082
diagact_arch 64103
get_clg2 64103
buchall_end 65212
Buchall_param 65219
init_famat 65756
FB_aut_perm 66258
FBgen 66258
ballvol 66258
delete_FB 66258
subFBgen 66258
small_norm 66733
assign_subFB 67018
clean_cols 93045
bad_check 96122
compute_R 96185
compute_multiple_of_R 121660
get_embs 122340
pre_allocate 122378
trim_list 122379
cleanarchunit 133868
init_GRHcheck 134670
free_GRHcheck 134673
nfsign_from_logarch 162323
isprincipal 174534
divide_p_id 185367
nf_cxlog_normalize 194924
modIm 204585
nfsign_tu 239975
nfsign_fu 241160
Fincke_Pohst_bound 265639
Fincke_Pohst_ideal 265639
bnf_get_ga 271795
bnf_get_GD 276751
bnf_build_cheapfu 285476
bnf_has_fu 285756
bad_subFB 307509
triv_gen 464583
GRHchk 496207
compute_multiple_of_R_pivot 577319
get_log_embed 723789
cache_prime_dec 920982
set_rel_alpha 946108
rel_embed 1014663
init_red_mod_units 1107780
red_mod_units 1107780
tailres 1129389
dump_gen 1225895
fact_ok 1226445
get_norm_fact 1229314
isprincipalarch 1234927
RgC_expbitprec 1234928
SPLIT_i 1250411
fixarch 1304769
split_ideal 1390157
Ur_ZC_mul 1390161
bnf_get_Ur 1390161
ZV_divrem 1390163
get_pr_lists 1390220
recover_partFB 1390220
bnf_get_vbase 1390240
bnf_get_W 1395133
isprincipalall 1406544
SPLIT 1406568
prec_arch 1408354
GRHok 1532703
bnfisprincipal0 1838871
fact_update 1978494
act_arch 2055027
add 2247849
set_fact 2249944
tailresback 2258771
add_rel 2422448
bnf_get_B 2780336
bnf_get_C 2814917
expbitprec 2838087
add_to_fact 2841456
already_known 2901724
add_rel_i 2905860
cleanarch 3064792
divide_p_quo 5270990
divide_p 5458729
addRe_modIm 6896399
get_fs 7507582
store 9190734
factorgen 16711621
can_factor 18121757
step 28024245

Generated by: LCOV version 1.16