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 30764-6b81f1f3fa) Lines: 1881 2002 94.0 %
Date: 2026-03-25 09:26:52 Functions: 104 104 100.0 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Leading_is_neg 57628765
Q_to_Fp 226838
Qdivii 143130029
Qdivis 1762560
Qdiviu 151482074
Zp_nosquare_m1 42
_serprec 8187500
addQp 4763009
addRc 310708202
addRq 1302
addTp 7
add_intmod_same 3410725
add_rfrac 3017228
add_rfrac_scal 8823769
add_scal 29398686
add_ser_scal 417278
addqf 77
addsub_frac 40739272
addsub_frac_i 14154023
addsub_polmod 7210
addsub_polmod_scal 13457863
addsub_pp 19974496
conj_i 31552442
conjvec 84
divRc 2893841
divRq 301
divTp 3674
div_T_scal 7293270
div_intmod_same 341537
div_polmod_same 37016
div_rfrac 1187496
div_rfrac_pol 260657
div_rfrac_scal 32435
div_scal_T 15557229
div_scal_pol 14531927
div_scal_rfrac 1052280
div_scal_ser 19096
div_ser 875766
div_ser_scal 1543591
divcR 23425332
divfq 42
divpT 1204910
divpp 13212274
divqf 63
divrunextu 213675891
fix_rfrac 206780
gadd 6246812119
gaddsg 270811653
gconj 390604
gdiv 452878565
gdivgs 13375985
gdivgu 61805579
gdivgunextu 1583803
ginv 38283686
gmul 8958355853
gmul2n 146078801
gmulsg 242559151
gmulug 283938451
gred_rfrac2 39473628
gred_rfrac_simple 57631881
gsqr 1343448045
gsub 2898123584
gsubsg 3267106
inv_polmod 189774
is_ext_qfr 98
kro_quad 35
mkpadic_mod 24594858
mulRc 355396083
mulRq 2387
mulTp 4985915
mul_gen_rfrac 161376
mul_intmod_same 2985103
mul_polmod 2674945
mul_polmod_same 8532791
mul_polmod_scal 3219554
mul_rfrac 7910194
mul_rfrac_scal 10435434
mul_scal 197840837
mul_self_scal 7663146
mul_ser_scal 323974
mulcIR 11893707
mulcc 281558804
mulcxI 15654539
mulcxmI 2985996
mulcxpowIs 5564942
mulpp 17505571
mulqf 28
mulqq 1127
mulrfrac 38072003
pol2ser 6378555
quad_polmod_conj 18403
quad_polmod_mul 5860237
quad_polmod_norm 18403
rfrac_denom_mul_scal 9852085
ser_add 4094149
ser_normalize 7658
setfrac 15036250
sqr_polmod 419392
sqr_ser_part 113907
sqrq 70
sub_intmod_same 1017828
transtype 154217663
utoi_sign 65021169
warn_coercion 126

Generated by: LCOV version 1.16