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-26 09:27:02 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 37016
sqr_ser_part 113907
mul_gen_rfrac 161376
inv_polmod 189774
fix_rfrac 206780
Q_to_Fp 226838
div_rfrac_pol 260657
mul_ser_scal 323974
div_intmod_same 341535
gconj 390604
add_ser_scal 417278
sqr_polmod 419392
div_ser 875766
sub_intmod_same 1017828
div_scal_rfrac 1052280
div_rfrac 1187496
divpT 1204910
div_ser_scal 1543591
gdivgunextu 1583803
Qdivis 1762582
mul_polmod 2674945
divRc 2893880
mul_intmod_same 2985122
mulcxmI 2986016
add_rfrac 3017228
mul_polmod_scal 3219548
gsubsg 3267103
add_intmod_same 3410725
ser_add 4094149
addQp 4763059
mulTp 4985907
mulcxpowIs 5565020
quad_polmod_mul 5860237
pol2ser 6378555
div_T_scal 7293143
mul_self_scal 7663139
mul_rfrac 7910194
_serprec 8187500
mul_polmod_same 8532791
add_rfrac_scal 8823769
rfrac_denom_mul_scal 9852085
mul_rfrac_scal 10435434
mulcIR 11893387
divpp 13213067
gdivgs 13375985
addsub_polmod_scal 13457856
addsub_frac_i 14154232
div_scal_pol 14531927
setfrac 15036465
div_scal_T 15557229
mulcxI 15654971
mulpp 17505691
addsub_pp 19975414
divcR 23425501
mkpadic_mod 24595369
add_scal 29398647
conj_i 31552613
mulrfrac 38071394
ginv 38283260
gred_rfrac2 39473628
addsub_frac 40739445
Leading_is_neg 57628765
gred_rfrac_simple 57631881
gdivgu 61806537
utoi_sign 65022765
Qdivii 143120895
gmul2n 146073858
Qdiviu 151470242
transtype 154217663
mul_scal 197840577
divrunextu 213720105
gmulsg 242525115
gaddsg 270811821
mulcc 281546277
gmulug 283938451
addRc 310704942
mulRc 355509878
gdiv 452877572
gsqr 1343432755
gsub 2898184389
gadd 6246109374
gmul 8957912960

Generated by: LCOV version 1.16