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 30733-eb2d773d38) Lines: 1880 2002 93.9 %
Date: 2026-03-03 09:24:12 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 57630053
Q_to_Fp 226838
Qdivii 142883970
Qdivis 1592572
Qdiviu 149754903
Zp_nosquare_m1 42
_serprec 7185100
addQp 4761830
addRc 307880722
addRq 1302
addTp 7
add_intmod_same 3341104
add_rfrac 3017228
add_rfrac_scal 8823776
add_scal 29391035
add_ser_scal 414478
addqf 77
addsub_frac 40596536
addsub_frac_i 14119997
addsub_polmod 7210
addsub_polmod_scal 13457728
addsub_pp 19974913
conj_i 31497084
conjvec 84
divRc 2286191
divRq 301
divTp 3674
div_T_scal 7092475
div_intmod_same 341536
div_polmod_same 37016
div_rfrac 1187741
div_rfrac_pol 260657
div_rfrac_scal 32267
div_scal_T 15548117
div_scal_pol 14531731
div_scal_rfrac 1043616
div_scal_ser 19096
div_ser 774266
div_ser_scal 1343391
divcR 23355943
divfq 42
divpT 1204910
divpp 13213360
divqf 63
divrunextu 213515217
fix_rfrac 206780
gadd 6184012201
gaddsg 270745966
gconj 390135
gdiv 439900219
gdivgs 12993085
gdivgu 60482734
gdivgunextu 1583803
ginv 36577782
gmul 8832026332
gmul2n 143583376
gmulsg 240922914
gmulug 283683119
gred_rfrac2 39476036
gred_rfrac_simple 57633155
gsqr 1279860730
gsub 2890065478
gsubsg 3235112
inv_polmod 189772
is_ext_qfr 98
kro_quad 35
mkpadic_mod 24594567
mulRc 354467905
mulRq 2324
mulTp 4984746
mul_gen_rfrac 161432
mul_intmod_same 2818764
mul_polmod 2674945
mul_polmod_same 8532021
mul_polmod_scal 3219064
mul_rfrac 7910859
mul_rfrac_scal 10435518
mul_scal 182155704
mul_self_scal 7646106
mul_ser_scal 321174
mulcIR 11645120
mulcc 279023432
mulcxI 15636296
mulcxmI 2985903
mulcxpowIs 5564190
mulpp 17503765
mulqf 28
mulqq 1127
mulrfrac 37740119
pol2ser 5638655
quad_polmod_conj 18403
quad_polmod_mul 5860237
quad_polmod_norm 18403
rfrac_denom_mul_scal 9852099
ser_add 3592949
ser_normalize 7658
setfrac 14998371
sqr_polmod 419392
sqr_ser_part 113207
sqrq 70
sub_intmod_same 1017828
transtype 154222185
utoi_sign 64601412
warn_coercion 126

Generated by: LCOV version 1.16