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 30824-18397de1d0) Lines: 1882 2002 94.0 %
Date: 2026-04-18 09:26:04 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 57629507
Q_to_Fp 226838
Qdivii 143041433
Qdivis 1762590
Qdiviu 151381929
Zp_nosquare_m1 42
_serprec 8187500
addQp 4762995
addRc 310765368
addRq 1302
addTp 7
add_intmod_same 3411644
add_rfrac 3017298
add_rfrac_scal 8823993
add_scal 29400551
add_ser_scal 417278
addqf 77
addsub_frac 40919078
addsub_frac_i 14244029
addsub_polmod 7210
addsub_polmod_scal 13458204
addsub_pp 19973813
conj_i 31556270
conjvec 84
divRc 2918697
divRq 301
divTp 3674
div_T_scal 7293140
div_intmod_same 341545
div_polmod_same 37044
div_rfrac 1187510
div_rfrac_pol 260657
div_rfrac_scal 32435
div_scal_T 15557271
div_scal_pol 14531955
div_scal_rfrac 1052294
div_scal_ser 19096
div_ser 875766
div_ser_scal 1543591
divcR 23430764
divfq 42
divpT 1204910
divpp 13211685
divqf 63
divrunextu 213488427
fix_rfrac 207018
gadd 6257350686
gaddsg 270817239
gconj 390611
gdiv 455345990
gdivgs 13378256
gdivgu 61804664
gdivgunextu 1583803
ginv 38488174
gmul 8960746395
gmul2n 150448731
gmulsg 244357035
gmulug 283938451
gred_rfrac2 39475112
gred_rfrac_simple 57632623
gsqr 1343867612
gsub 2904932351
gsubsg 3270047
inv_polmod 189770
is_ext_qfr 98
kro_quad 35
mkpadic_mod 24593746
mulRc 355350771
mulRq 2387
mulTp 4985909
mul_gen_rfrac 161376
mul_intmod_same 2987648
mul_polmod 2674945
mul_polmod_same 8532875
mul_polmod_scal 3219624
mul_rfrac 7910292
mul_rfrac_scal 10435532
mul_scal 198313168
mul_self_scal 7663071
mul_ser_scal 323974
mulcIR 11905709
mulcc 281704081
mulcxI 15655030
mulcxmI 2985846
mulcxpowIs 5563160
mulpp 17505609
mulqf 28
mulqq 1127
mulrfrac 38070700
pol2ser 6378555
quad_polmod_conj 18403
quad_polmod_mul 5860265
quad_polmod_norm 18403
rfrac_denom_mul_scal 9852099
ser_add 4094149
ser_normalize 7658
setfrac 15142653
sqr_polmod 419392
sqr_ser_part 113907
sqrq 70
sub_intmod_same 1017835
transtype 154222045
utoi_sign 65153979
warn_coercion 126

Generated by: LCOV version 1.16