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) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31092-e6893b0017) Lines: 94.0 % 2028 1906
Test Date: 2026-09-16 17:02:44 Functions: 100.0 % 104 104
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
Leading_is_neg 57792184
Q_to_Fp 226838
Qdivii 146461007
Qdivis 2587661
Qdiviu 154026987
Zp_nosquare_m1 42
_serprec 8514516
addQp 4763203
addRc 313305542
addRq 1596
addTp 7
add_intmod_same 3416156
add_rfrac 3017298
add_rfrac_scal 8812479
add_scal 43070618
add_ser_scal 425209
addqf 77
addsub_frac 41416254
addsub_frac_i 14593644
addsub_polmod 7203
addsub_polmod_scal 13604334
addsub_pp 19978757
base_change 154407970
conj_i 32594616
conjvec 84
divRc 3408132
divRq 301
divTp 3674
div_T_scal 7412606
div_intmod_same 341506
div_polmod_same 38087
div_rfrac 1187251
div_rfrac_pol 262365
div_rfrac_scal 32139
div_scal_T 9263698
div_scal_pol 9254006
div_scal_rfrac 37767
div_scal_ser 19292
div_ser 908987
div_ser_scal 1608941
divcR 24801900
divfq 42
divpT 1204910
divpp 13216944
divqf 63
divrunextu 216421152
fix_rfrac 207018
gadd 6605491698
gaddsg 270842481
gconj 390611
gdiv 465805150
gdivgs 29789278
gdivgu 61985234
gdivgunextu 1583943
ginv 49371371
gmul 9176596579
gmul2n 155008495
gmulsg 262204768
gmulug 283956448
gred_rfrac 44825263
gred_rfrac_simple 57797148
gsqr 1218331222
gsub 2937888590
gsubsg 3271588
inv_polmod 192253
is_ext_qfr 98
kro_quad 35
mkpadic_mod 24599342
mulRc 360940114
mulRq 2324
mulTp 4985951
mul_gen_rfrac 161432
mul_intmod_same 3138756
mul_polmod 2674945
mul_polmod_same 8646527
mul_polmod_scal 3288167
mul_rfrac 7910397
mul_rfrac_scal 10454352
mul_scal 155047590
mul_self_scal 8028111
mul_ser_scal 326494
mulcIR 11902462
mulcc 286512304
mulcxI 15680760
mulcxmI 3166662
mulcxpowIs 5749844
mulpp 17506470
mulqf 28
mulqq 1127
mulrfrac 38175670
pol2ser 6631815
quad_polmod_conj 18725
quad_polmod_mul 5861735
quad_polmod_norm 18725
rfrac_denom_mul_scal 9959296
ser_add 4257657
ser_normalize 7658
setfrac 15562335
sqr_polmod 426147
sqr_ser_part 114411
sqrq 70
sub_intmod_same 1031401
utoi_sign 65813644
warn_coercion 112

Generated by: LCOV version 2.0-1