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 30848-b1463d63da) Lines: 1881 2002 94.0 %
Date: 2026-04-30 09:27:33 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 192397
fix_rfrac 207018
Q_to_Fp 226838
div_rfrac_pol 260657
mul_ser_scal 323974
div_intmod_same 341561
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 1762585
mul_polmod 2674945
divRc 2918787
mulcxmI 2985928
mul_intmod_same 2987776
add_rfrac 3017298
gsubsg 3270041
mul_polmod_scal 3284724
add_intmod_same 3411659
ser_add 4094177
addQp 4763012
mulTp 4985898
mulcxpowIs 5564194
quad_polmod_mul 5861861
pol2ser 6378562
div_T_scal 7295836
mul_self_scal 7663741
mul_rfrac 7910292
_serprec 8187556
mul_polmod_same 8647444
add_rfrac_scal 8823993
rfrac_denom_mul_scal 9852099
mul_rfrac_scal 10435532
mulcIR 11907125
divpp 13210645
gdivgs 13378369
addsub_polmod_scal 13598740
addsub_frac_i 14260439
div_scal_pol 14531955
setfrac 15159095
div_scal_T 15557271
mulcxI 15655355
mulpp 17505245
addsub_pp 19972936
divcR 23431339
mkpadic_mod 24593027
add_scal 29438869
conj_i 31556648
mulrfrac 38071999
ginv 38493560
gred_rfrac2 39476029
addsub_frac 40954993
Leading_is_neg 57629514
gred_rfrac_simple 57633715
gdivgu 61801405
utoi_sign 65172838
Qdivii 143111125
gmul2n 150458059
Qdiviu 151448041
transtype 154223893
mul_scal 198406242
divrunextu 213568453
gmulsg 244387166
gaddsg 270816231
mulcc 281731864
gmulug 283938450
addRc 310813288
mulRc 355346215
gdiv 455363387
gsqr 1344023178
gsub 2905355769
gadd 6259376632
gmul 8962381370

Generated by: LCOV version 1.16