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 - FpX_factor.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30735-65f72320ad) Lines: 1308 1426 91.7 %
Date: 2026-03-10 09:24:00 Functions: 114 124 91.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
F2x_Berlekamp_i 35451
F2x_Berlekamp_ker 23388
F2x_Cantor_i 302837
F2x_ddf 7
F2x_ddf_simple 353922
F2x_ddf_to_ddf2 7
F2x_degfact 0
F2x_degfact_2 19677
F2x_edf_simple 33424
F2x_factor 15083
F2x_factor_2 1186788
F2x_factor_Cantor 302837
F2x_factor_Shoup 353916
F2x_factor_deg2 1206479
F2x_factor_i 1544768
F2x_factor_squarefree 338273
F2x_is_irred 238
F2x_is_irred_2 14
F2x_quad_factortype 471582
F2x_split_Berlekamp 35896
F2xq_frobtrace 22867
FE_concat 1910993
Fl_disc_bc 30262231
Flx_Xn1 2139
Flx_Xnm1 2249
Flx_cubic_root 427931
Flx_ddf 0
Flx_ddf_Shoup 9239028
Flx_ddf_pre 0
Flx_degfact 7863923
Flx_degfact_2 2515860
Flx_edf 741011
Flx_edf_rec 1391440
Flx_edf_simple 411017
Flx_factor 705555
Flx_factor_2 2035809
Flx_factor_Cantor 1607242
Flx_factor_Shoup 1680124
Flx_factor_deg2 4551636
Flx_factor_i 11588778
Flx_factor_squarefree 346578
Flx_factor_squarefree_pre 7308255
Flx_is_irred 1057
Flx_is_irred_2 56
Flx_is_totally_split 81354
Flx_is_totally_split_i 81347
Flx_isirred_Cantor 1078
Flx_ispower 3444
Flx_nbfact 669424
Flx_nbfact_Frobenius 0
Flx_nbfact_Frobenius_pre 669417
Flx_nbfact_by_degree 1455857
Flx_nbfact_pre 669424
Flx_nbroots 4768182
Flx_oneroot 2520
Flx_oneroot_mod_2 98
Flx_oneroot_pre 4436597
Flx_oneroot_pre_i 4478113
Flx_oneroot_split 14
Flx_oneroot_split_pre 41631
Flx_otherroot 16448415
Flx_quad_factortype 2489837
Flx_quad_root 27777016
Flx_root_mod_2 94306
Flx_roots 1372
Flx_roots_pre 26909170
Flx_simplefact_Cantor 5351333
FpX_cubic_root 119
FpX_ddf 7
FpX_ddf_Shoup 1022
FpX_ddf_degree 4256
FpX_ddf_i 0
FpX_degfact 47947
FpX_degfact_2 14
FpX_edf 434
FpX_edf_rec 1051
FpX_edf_simple 0
FpX_factor 4425172
FpX_factor_2 1485
FpX_factor_Cantor 909
FpX_factor_Shoup 1008
FpX_factor_Yun 1713
FpX_factor_deg2 1506
FpX_factor_i 2429
FpX_factor_squarefree 347326
FpX_is_irred 112
FpX_is_irred_2 7
FpX_is_totally_split 0
FpX_isirred_Cantor 0
FpX_ispower 168
FpX_nbfact 0
FpX_nbfact_Frobenius 0
FpX_nbroots 153946
FpX_oneroot 234086
FpX_oneroot_i 5323
FpX_oneroot_split 1043
FpX_otherroot 10010
FpX_quad_factortype 21
FpX_quad_root 14676
FpX_roots 433546
FpX_roots_i 8247
FpX_roots_mult 226478
FpX_simplefact_Cantor 14
FpX_split_part 250290
ZX_factmod_init 4473240
ZX_rootmod_init 667632
all_roots_mod_p 600
cmpGuGu 16449089
ddf_to_ddf2 7
ddf_to_ddf2_i 14
ddf_to_nbfact 2351210
good_root_of_unity 105
prime_fact 70
split_Flx_cut_out_roots 4875680
split_add 5261593
split_add_done 521212
split_done 477180
split_init 4884586
split_moveto_done 5262430
split_nonsquares 31529
split_squares 31529
split_todo 426800
trivial_fact 354091
vddf_to_simplefact 5352214

Generated by: LCOV version 1.16