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 - gen1.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30773-2078653b96) Lines: 1881 2002 94.0 %
Date: 2026-04-02 09:26:53 Functions: 104 104 100.0 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addTp 7
mulqf 28
kro_quad 35
Zp_nosquare_m1 42
divfq 42
divqf 63
sqrq 70
addqf 77
conjvec 84
is_ext_qfr 98
warn_coercion 126
divRq 301
mulqq 1127
addRq 1302
mulRq 2387
divTp 3674
addsub_polmod 7210
ser_normalize 7658
quad_polmod_conj 18403
quad_polmod_norm 18403
div_scal_ser 19096
div_rfrac_scal 32435
div_polmod_same 37044
sqr_ser_part 113907
mul_gen_rfrac 161376
inv_polmod 189772
fix_rfrac 207018
Q_to_Fp 226838
div_rfrac_pol 260657
mul_ser_scal 323974
div_intmod_same 341553
gconj 390604
add_ser_scal 417278
sqr_polmod 419392
div_ser 875766
sub_intmod_same 1017835
div_scal_rfrac 1052294
div_rfrac 1187510
divpT 1204910
div_ser_scal 1543591
gdivgunextu 1583803
Qdivis 1762579
mul_polmod 2674945
divRc 2894020
mulcxmI 2985968
mul_intmod_same 2987673
add_rfrac 3017298
mul_polmod_scal 3219621
gsubsg 3267103
add_intmod_same 3411651
ser_add 4094149
addQp 4763001
mulTp 4985910
mulcxpowIs 5564536
quad_polmod_mul 5860265
pol2ser 6378555
div_T_scal 7293249
mul_self_scal 7663005
mul_rfrac 7910292
_serprec 8187500
mul_polmod_same 8532875
add_rfrac_scal 8823993
rfrac_denom_mul_scal 9852099
mul_rfrac_scal 10435532
mulcIR 11894846
divpp 13211923
gdivgs 13376059
addsub_polmod_scal 13458195
addsub_frac_i 14154123
div_scal_pol 14531955
setfrac 15036347
div_scal_T 15557271
mulcxI 15654463
mulpp 17505397
addsub_pp 19974346
divcR 23425518
mkpadic_mod 24594007
add_scal 29399212
conj_i 31552323
mulrfrac 38071663
ginv 38281443
gred_rfrac2 39473922
addsub_frac 40739339
Leading_is_neg 57629507
gred_rfrac_simple 57632623
gdivgu 61805637
utoi_sign 65021812
Qdivii 143103923
gmul2n 149700327
Qdiviu 151457401
transtype 154219665
mul_scal 197841098
divrunextu 213540076
gmulsg 244333549
gaddsg 270811438
mulcc 281552678
gmulug 283938451
addRc 310672014
mulRc 355208611
gdiv 455092570
gsqr 1343281156
gsub 2905432262
gadd 6256325822
gmul 8958372675

Generated by: LCOV version 1.16