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 - base1.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30838-aa3635ec72) Lines: 1734 1830 94.8 %
Date: 2026-04-27 09:26:59 Functions: 141 159 88.7 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
FpX_FpC_nfpoleval 8824
Polred 70
QX_table_nfpoleval 97409
RgFV_to_FlxqV 1239
RgF_to_Flxq 8092
ZC_galoisapply 97628
ZM_image_shallow 13082
ZXX_Q_mul 8897
ZX_Q_mul 6905824
ZX_Q_normalize 845210
ZX_Z_normalize 848206
ZX_canon_neg 89776
ZX_cmp 30324
ZX_is_better 52054
ZX_primitive_to_monic 845531
ZX_to_monic 0
badp 49
check_ZKmodule 6737
check_ZKmodule_i 6793
checkabgrp 24136
checkbid 1521437
checkbid_i 1791336
checkbnf 3391416
checkbnf_i 5390397
checkbnr 1797952
checkbnr_i 1981202
checknf 89473804
checknf_i 92653888
checknfelt_mod 614798
checkrnf 425525
checkrnf_i 437239
checksqmat 0
chk_gen 100463
chk_gen_init 14266
chk_gen_prec 32613
cmpii_polred 128468
complex_norm 33953209
elt_galoisapply 49
elt_galoismatrixapply 0
embed_T2 72149
embed_norm 17957118
embednorm_T2 0
factoredpolred 0
factoredpolred2 0
filter 4095
findmindisc 14273
gal_check_pol 2513
galoisapply 128839
get_Tr 85359
get_aut 8190
get_bas_den 206402
get_bnf 28525
get_bnfpol 112
get_nf 116578
get_nfindex 2597
get_nfpol 679088
get_pol 264472
get_polchar 100463
get_red_G 73941
get_roots 242718
idealfrobenius 105
idealfrobenius_aut 98
idealinertiagroup 1834
idealquasifrob 1491
idealramfrobenius 0
idealramfrobenius_aut 616
idealramgroups 126
idealramgroups_aut 2408
idealramgroupstame 1911
idealramgroupswild 497
incl_disc 539
make_G 269540
make_M 269545
make_M_G 269545
make_Tr 28814
nf_basden 91899
nf_get_allroots 0
nf_get_prec 1281298
nf_input_type 87400
nf_multable 85361
nf_multable_worker 557277
nfcertify 3367
nffp_init 177653
nfgaloismatrix 96508
nfgaloismatrixapply 13916
nfgaloispermtobasis 1379
nfinit 7311
nfinit0 11714
nfinit_basic 87400
nfinit_basic_flag 14343
nfinit_basic_partial 3920
nfinit_complete 85356
nfinitred 182
nfinitred2 0
nfisincl 112
nfisincl0 7336
nfisincl_from_fact 7224
nfisincl_from_fact_frac 1232
nfisisom 77
nfmaxord_complete 170718
nfmaxord_to_nf 85358
nfnewprec 161
nfnewprec_shallow 91871
nfpoleval 11151
nfpolred 280
nfsplitting 0
nfsplitting0 1435
nfsplitting_auto 1232
nfsplitting_composite 1421
nftyp 269871
partmap_reverse 7343
partmap_reverse_frac 8085
partmap_reverse_frac_worker 8085
polred 14
polred0 56
polred2 0
polred_aux 4130
polred_init 18361
polredabs 13426
polredabs0 14000
polredabs2 0
polredabs_i 14273
polredabsall 0
polredbest 3528
polredbest_aux 4067
polredbest_i 3885
polredord 21
poltomonic 42
pr_galoisapply 7
pr_galoismatrixapply 0
pr_make 7
prec_fix 302153
primes_certify 3367
quicktrace 393706
rawcheckbnf 51926
rawchecknf 51072
real_norm 167481
remove_duplicates 14000
rnfnewprec 0
rnfnewprec_shallow 56
rnfpolred_i 637
rnfpolredabs 280
rnfpolredbest 357
set_LLL_basis 103441
set_mulid 22707
smallpolred 0
smallpolred2 0
tests_OK 287
try_polmin 136483
tschirnhaus 7634
typv6 126511
v10checknf 217203
v11checkbnf 42749
v13checkgchar 938
v13checkrnf 426246
v9checkgal 665
vecgaloisapply 7
vecgaloismatrixapply 0
zk_galoisapplymod 6276

Generated by: LCOV version 1.16