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.18.1 lcov report (development 31042-0fbe168e69) Lines: 94.0 % 2028 1906
Test Date: 2026-07-23 17:04:59 Functions: 100.0 % 104 104
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function 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 112
divRq 301
mulqq 1127
addRq 1596
mulRq 2324
divTp 3674
addsub_polmod 7203
ser_normalize 7658
quad_polmod_conj 18725
quad_polmod_norm 18725
div_scal_ser 19292
div_rfrac_scal 32139
div_scal_rfrac 37767
div_polmod_same 38087
sqr_ser_part 114411
mul_gen_rfrac 161432
inv_polmod 192253
fix_rfrac 207018
Q_to_Fp 226838
div_rfrac_pol 262365
mul_ser_scal 326494
div_intmod_same 341510
gconj 390611
add_ser_scal 425209
sqr_polmod 426147
div_ser 908987
sub_intmod_same 1031401
div_rfrac 1187251
divpT 1204910
gdivgunextu 1583943
div_ser_scal 1608941
Qdivis 2587661
mul_polmod 2674945
add_rfrac 3017298
mul_intmod_same 3138784
mulcxmI 3166662
gsubsg 3271592
mul_polmod_scal 3288167
divRc 3408110
add_intmod_same 3416161
ser_add 4257657
addQp 4763203
mulTp 4985951
mulcxpowIs 5749844
quad_polmod_mul 5861735
pol2ser 6631815
div_T_scal 7412679
mul_rfrac 7910397
mul_self_scal 8028265
_serprec 8514516
mul_polmod_same 8646527
add_rfrac_scal 8812479
div_scal_pol 9254006
div_scal_T 9263698
rfrac_denom_mul_scal 9959295
mul_rfrac_scal 10454352
mulcIR 11901414
divpp 13216944
addsub_polmod_scal 13604334
addsub_frac_i 14584338
setfrac 15555742
mulcxI 15680734
mulpp 17506470
addsub_pp 19978757
mkpadic_mod 24599342
divcR 24801920
gdivgs 29789236
conj_i 32594433
mulrfrac 38175140
ginv 38808167
addsub_frac 41416482
add_scal 43070852
gred_rfrac 44825263
Leading_is_neg 57792183
gred_rfrac_simple 57797147
gdivgu 61985213
utoi_sign 65610124
Qdivii 144888811
Qdiviu 152532853
base_change 154407967
gmul2n 155003921
mul_scal 155047274
divrunextu 216119974
gmulsg 262157547
gaddsg 270842487
gmulug 283956448
mulcc 286495221
addRc 313300681
mulRc 360946891
gdiv 464235784
gsqr 1218312154
gsub 2937019855
gadd 6605015997
gmul 9175404839

Generated by: LCOV version 2.0-1