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 30735-65f72320ad) Lines: 1881 2002 94.0 %
Date: 2026-03-09 09:24:55 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 18403
quad_polmod_norm 18403
div_scal_ser 19096
div_rfrac_scal 32435
div_polmod_same 37016
sqr_ser_part 113207
mul_gen_rfrac 161376
inv_polmod 189774
fix_rfrac 206780
Q_to_Fp 226838
div_rfrac_pol 260657
mul_ser_scal 321174
div_intmod_same 341557
gconj 390135
add_ser_scal 414478
sqr_polmod 419392
div_ser 774266
sub_intmod_same 1017828
div_scal_rfrac 1052280
div_rfrac 1187496
divpT 1204910
div_ser_scal 1343391
gdivgunextu 1583803
Qdivis 1592572
divRc 2286132
mul_polmod 2674945
mul_intmod_same 2818706
mulcxmI 2985927
add_rfrac 3017228
mul_polmod_scal 3219551
gsubsg 3235114
add_intmod_same 3341076
ser_add 3592949
addQp 4762993
mulTp 4985895
mulcxpowIs 5564118
pol2ser 5638655
quad_polmod_mul 5860237
div_T_scal 7092833
_serprec 7185100
mul_self_scal 7646258
mul_rfrac 7910194
mul_polmod_same 8532791
add_rfrac_scal 8823769
rfrac_denom_mul_scal 9851840
mul_rfrac_scal 10435434
mulcIR 11645253
gdivgs 12993107
divpp 13212632
addsub_polmod_scal 13457862
addsub_frac_i 14120023
div_scal_pol 14531927
setfrac 14998397
div_scal_T 15557229
mulcxI 15636168
mulpp 17505562
addsub_pp 19974770
divcR 23355932
mkpadic_mod 24594765
add_scal 29391898
conj_i 31497396
ginv 36580055
mulrfrac 37740968
gred_rfrac2 39473628
addsub_frac 40596488
Leading_is_neg 57627946
gred_rfrac_simple 57631048
gdivgu 60481452
utoi_sign 64607955
Qdivii 142883594
gmul2n 143589253
Qdiviu 149755198
transtype 154216025
mul_scal 197771376
divrunextu 213887168
gmulsg 240967244
gaddsg 270746036
mulcc 279018848
gmulug 283683119
addRc 307885866
mulRc 354668555
gdiv 439919299
gsqr 1337513324
gsub 2890333038
gadd 6188109927
gmul 8905007510

Generated by: LCOV version 1.16