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 30842-de08e65e1b) Lines: 1881 2002 94.0 %
Date: 2026-04-29 09:26:11 Functions: 104 104 100.0 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addTp 7
mulqf 28
kro_quad 35
Zp_nosquare_m1 42
divfq 42
divqf 63
sqrq 70
addqf 77
conjvec 84
is_ext_qfr 98
warn_coercion 126
divRq 301
mulqq 1127
addRq 1302
mulRq 2387
divTp 3674
addsub_polmod 7210
ser_normalize 7658
quad_polmod_conj 18669
quad_polmod_norm 18669
div_scal_ser 19096
div_rfrac_scal 32435
div_polmod_same 38150
sqr_ser_part 113907
mul_gen_rfrac 161376
inv_polmod 192400
fix_rfrac 207018
Q_to_Fp 226838
div_rfrac_pol 260657
mul_ser_scal 323974
div_intmod_same 341553
gconj 390611
add_ser_scal 417285
sqr_polmod 426119
div_ser 875766
sub_intmod_same 1017835
div_scal_rfrac 1052294
div_rfrac 1187510
divpT 1204910
div_ser_scal 1543591
gdivgunextu 1583803
Qdivis 1762587
mul_polmod 2674945
divRc 2918883
mulcxmI 2985888
mul_intmod_same 2987694
add_rfrac 3017298
gsubsg 3270046
mul_polmod_scal 3284724
add_intmod_same 3411645
ser_add 4094177
addQp 4763017
mulTp 4985880
mulcxpowIs 5563462
quad_polmod_mul 5861861
pol2ser 6378562
div_T_scal 7295904
mul_self_scal 7663435
mul_rfrac 7910292
_serprec 8187556
mul_polmod_same 8647444
add_rfrac_scal 8823993
rfrac_denom_mul_scal 9852099
mul_rfrac_scal 10435532
mulcIR 11907251
divpp 13212055
gdivgs 13378398
addsub_polmod_scal 13598740
addsub_frac_i 14260412
div_scal_pol 14531955
setfrac 15159034
div_scal_T 15557271
mulcxI 15655093
mulpp 17505495
addsub_pp 19974076
divcR 23431434
mkpadic_mod 24593996
add_scal 29439181
conj_i 31556609
mulrfrac 38069821
ginv 38492784
gred_rfrac2 39476029
addsub_frac 40954838
Leading_is_neg 57629514
gred_rfrac_simple 57633715
gdivgu 61802752
utoi_sign 65169794
Qdivii 143076637
gmul2n 150451145
Qdiviu 151414665
transtype 154223893
mul_scal 198406706
divrunextu 213304248
gmulsg 244342623
gaddsg 270816349
mulcc 281706543
gmulug 283938451
addRc 310789255
mulRc 355221285
gdiv 455356937
gsqr 1343928214
gsub 2905154667
gadd 6257988917
gmul 8961708168

Generated by: LCOV version 1.16