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 30862-ea47bd413c) Lines: 1881 2002 94.0 %
Date: 2026-05-06 09:26:47 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 57630004
Q_to_Fp 226838
Qdivii 143139229
Qdivis 1781425
Qdiviu 151468957
Zp_nosquare_m1 42
_serprec 8514334
addQp 4763028
addRc 311308927
addRq 1302
addTp 7
add_intmod_same 3411658
add_rfrac 3017298
add_rfrac_scal 8823993
add_scal 29447026
add_ser_scal 425153
addqf 77
addsub_frac 40957246
addsub_frac_i 14260303
addsub_polmod 7210
addsub_polmod_scal 13598740
addsub_pp 19974146
conj_i 32426521
conjvec 84
divRc 2926983
divRq 301
divTp 3674
div_T_scal 7362675
div_intmod_same 341559
div_polmod_same 38150
div_rfrac 1187510
div_rfrac_pol 260657
div_rfrac_scal 32435
div_scal_T 15557439
div_scal_pol 14531927
div_scal_rfrac 1052294
div_scal_ser 19292
div_ser 908987
div_ser_scal 1608941
divcR 24474363
divfq 42
divpT 1204910
divpp 13212705
divqf 63
divrunextu 213650785
fix_rfrac 207018
gadd 6270541876
gaddsg 270841992
gconj 390611
gdiv 459306178
gdivgs 13463314
gdivgu 61797307
gdivgunextu 1583803
ginv 38547705
gmul 8979952523
gmul2n 150486809
gmulsg 244401072
gmulug 283956442
gred_rfrac2 39476288
gred_rfrac_simple 57634205
gsqr 1345794481
gsub 2910876490
gsubsg 3271120
inv_polmod 192397
is_ext_qfr 98
kro_quad 35
mkpadic_mod 24594888
mulRc 355766418
mulRq 2387
mulTp 4985936
mul_gen_rfrac 161376
mul_intmod_same 2987758
mul_polmod 2674945
mul_polmod_same 8647444
mul_polmod_scal 3284727
mul_rfrac 7910292
mul_rfrac_scal 10435791
mul_scal 198412319
mul_self_scal 7667529
mul_ser_scal 326494
mulcIR 11907747
mulcc 284863973
mulcxI 15656303
mulcxmI 2986307
mulcxpowIs 5565535
mulpp 17505466
mulqf 28
mulqq 1127
mulrfrac 38170505
pol2ser 6631773
quad_polmod_conj 18669
quad_polmod_mul 5861861
quad_polmod_norm 18669
rfrac_denom_mul_scal 9852071
ser_add 4257566
ser_normalize 7658
setfrac 15158956
sqr_polmod 426119
sqr_ser_part 114271
sqrq 70
sub_intmod_same 1017835
transtype 154225041
utoi_sign 65169797
warn_coercion 126

Generated by: LCOV version 1.16