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-05 09:26:54 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 19292
div_rfrac_scal 32435
div_polmod_same 38150
sqr_ser_part 114271
mul_gen_rfrac 161376
inv_polmod 192398
fix_rfrac 207018
Q_to_Fp 226838
div_rfrac_pol 260657
mul_ser_scal 326494
div_intmod_same 341569
gconj 390611
add_ser_scal 425153
sqr_polmod 426119
div_ser 908987
sub_intmod_same 1017835
div_scal_rfrac 1052294
div_rfrac 1187510
divpT 1204910
gdivgunextu 1583803
div_ser_scal 1608941
Qdivis 1781425
mul_polmod 2674945
divRc 2926663
mulcxmI 2986291
mul_intmod_same 2987843
add_rfrac 3017298
gsubsg 3271126
mul_polmod_scal 3284721
add_intmod_same 3411668
ser_add 4257566
addQp 4763044
mulTp 4985908
mulcxpowIs 5565276
quad_polmod_mul 5861861
pol2ser 6631773
div_T_scal 7362676
mul_self_scal 7667711
mul_rfrac 7910292
_serprec 8514334
mul_polmod_same 8647444
add_rfrac_scal 8823993
rfrac_denom_mul_scal 9852071
mul_rfrac_scal 10435791
mulcIR 11905131
divpp 13212343
gdivgs 13463138
addsub_polmod_scal 13598736
addsub_frac_i 14260323
div_scal_pol 14531927
setfrac 15158965
div_scal_T 15557439
mulcxI 15655643
mulpp 17505602
addsub_pp 19974070
divcR 24473908
mkpadic_mod 24595008
add_scal 29446984
conj_i 32425896
mulrfrac 38170334
ginv 38547001
gred_rfrac2 39476288
addsub_frac 40957335
Leading_is_neg 57630004
gred_rfrac_simple 57634205
gdivgu 61796877
utoi_sign 65170877
Qdivii 143137632
gmul2n 150483547
Qdiviu 151467330
transtype 154225041
mul_scal 198411814
divrunextu 213709006
gmulsg 244402856
gaddsg 270841954
gmulug 283956432
mulcc 284831938
addRc 311310396
mulRc 355843646
gdiv 459301658
gsqr 1345788462
gsub 2910854819
gadd 6270575670
gmul 8979829564

Generated by: LCOV version 1.16