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 30673-b6380924e9) Lines: 1880 2002 93.9 %
Date: 2026-02-08 09:23:25 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 57790160
Q_to_Fp 226838
Qdivii 141935575
Qdivis 1592285
Qdiviu 148812645
Zp_nosquare_m1 42
_serprec 7185086
addQp 4762969
addRc 307894964
addRq 1288
addTp 7
add_intmod_same 3338875
add_rfrac 3017228
add_rfrac_scal 8812213
add_scal 42826843
add_ser_scal 414436
addqf 77
addsub_frac 40599038
addsub_frac_i 14120867
addsub_polmod 7203
addsub_polmod_scal 13456523
addsub_pp 19974292
conj_i 31492400
conjvec 84
divRc 2286211
divRq 301
divTp 3674
div_T_scal 7128748
div_intmod_same 341492
div_polmod_same 37016
div_rfrac 1187237
div_rfrac_pol 262365
div_rfrac_scal 32139
div_scal_T 9266449
div_scal_pol 9258206
div_scal_rfrac 37767
div_scal_ser 19096
div_ser 774266
div_ser_scal 1343391
divcR 23353055
divfq 42
divpT 1204910
divpp 13212270
divqf 63
divrunextu 213830929
fix_rfrac 206780
gadd 6148540586
gaddsg 270740441
gconj 390135
gdiv 439097256
gdivgs 13001733
gdivgu 60480666
gdivgunextu 1583803
ginv 36548723
gmul 8694084204
gmul2n 143723330
gmulsg 239724918
gmulug 283683119
gred_rfrac2 44823163
gred_rfrac_simple 57794249
gsqr 1184030053
gsub 2887674012
gsubsg 3235143
inv_polmod 189698
is_ext_qfr 98
kro_quad 35
mkpadic_mod 24593925
mulRc 354474546
mulRq 2324
mulTp 4985897
mul_gen_rfrac 161432
mul_intmod_same 2788752
mul_polmod 2674945
mul_polmod_same 8529774
mul_polmod_scal 3238992
mul_rfrac 7910299
mul_rfrac_scal 10454093
mul_scal 154346219
mul_self_scal 7646229
mul_ser_scal 321174
mulcIR 11645419
mulcc 279024358
mulcxI 15629207
mulcxmI 2985886
mulcxpowIs 5563279
mulpp 17505431
mulqf 28
mulqq 1127
mulrfrac 37742787
pol2ser 5638655
quad_polmod_conj 18403
quad_polmod_mul 5860209
quad_polmod_norm 18403
rfrac_denom_mul_scal 9959022
ser_add 3592942
ser_normalize 7658
setfrac 14999669
sqr_polmod 419385
sqr_ser_part 113207
sqrq 70
sub_intmod_same 1021769
transtype 154397901
utoi_sign 64652031
warn_coercion 112

Generated by: LCOV version 1.16