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 30786-ffec283a2b) Lines: 2218 2538 87.4 %
Date: 2026-04-07 09:25:56 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 1204
FlxqX_chinese_unit 1379
try_elt 1657
divide_p_elt 2341
bnfinit0 2639
Vbase_to_FB 3426
pr_index 3426
idealHNF_mulred 3525
needed_bitprec 3857
idealmulpowprime2 4761
makecycgen 4956
ZV_mul 7332
pr_orbit_fill 11865
makeunits 24922
subFB_change 26648
bnf_build_cycgen 26726
genback 28784
add_principal_part 32327
expandext 32347
isprincipalfact 32347
bnf_compactfu 37415
RgM_expbitprec 48846
get_regulator 48941
bnf_build_units 50745
matbotidembs 55392
matenlarge 55392
get_random_ideal 56524
rnd_rel 56525
rnd_rel_seq 56525
_nfnewprec 57787
matbotid 62532
Buchall 62618
small_norm_prec 64050
automorphism_perms 64054
compute_invres 64056
getfu 64056
nthideal 64056
class_group_gen 64057
primeneeded 64057
extract_full_lattice 64064
automorphism_matrices 64118
add_cyclotomic_units 64129
delete_cache 64129
init_rel 64129
nfcyclotomicunits 64129
reallocate 64129
diagact_arch 64154
get_clg2 64154
Buchall_param 65257
buchall_end 65260
init_famat 65861
FBgen 66302
ballvol 66305
delete_FB 66305
FB_aut_perm 66306
subFBgen 66306
small_norm 66780
small_norm_seq 66780
assign_subFB 67028
clean_cols 93249
bad_check 96215
compute_R 96276
compute_multiple_of_R 121785
get_embs 122484
pre_allocate 123378
trim_list 123378
cleanarchunit 133979
nfsign_from_logarch 162325
isprincipal 174779
divide_p_id 185469
init_GRHcheck 186219
free_GRHcheck 186221
nf_cxlog_normalize 197126
modIm 204724
nfsign_tu 239974
nfsign_fu 241133
Fincke_Pohst_bound 267540
Fincke_Pohst_ideal_both 267546
Fincke_Pohst_ideal 267547
bnf_get_ga 271834
bnf_get_GD 276790
bnf_build_cheapfu 285468
bnf_has_fu 285754
bad_subFB 308274
triv_gen 464660
GRHchk 496716
compute_multiple_of_R_pivot 578193
get_log_embed 726124
cache_prime_dec 921977
set_rel_alpha 949362
rel_embed 1017674
init_red_mod_units 1107813
red_mod_units 1107813
tailres 1130134
dump_gen 1228036
fact_ok 1228538
get_norm_fact 1231483
RgC_expbitprec 1237090
isprincipalarch 1237090
SPLIT_i 1252979
fixarch 1306995
split_ideal 1392547
Ur_ZC_mul 1392550
ZV_divrem 1392550
bnf_get_Ur 1392550
recover_partFB 1392609
get_pr_lists 1392610
bnf_get_vbase 1392630
bnf_get_W 1397521
SPLIT 1408956
isprincipalall 1409085
prec_arch 1410879
bnfisprincipal0 1841333
act_arch 2057476
fact_update 2124569
add 2250562
tailresback 2260265
GRHok 2303842
set_fact 2329342
add_rel 2502520
bnf_get_B 2785114
bnf_get_C 2819984
expbitprec 2840438
add_to_fact 2933456
already_known 2983274
add_rel_i 2987445
cleanarch 3071771
divide_p_quo 5498792
divide_p 5686594
addRe_modIm 6907243
get_fs 7514413
store 9537334
factorgen 17382103
can_factor 18794746
step 29168847

Generated by: LCOV version 1.16