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 - trans1.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30702-bddb8d6928) Lines: 2194 2259 97.1 %
Date: 2026-02-23 02:23:56 Functions: 168 169 99.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Pi2n 25004998
PiI2 228730
PiI2n 257673
Qp_exp 92920
Qp_exp_prec 76
Qp_exp_safe 93314
Qp_log 168079
Qp_sqrt 1586
Qp_sqrtn 2163
T2 35593460
Up_sqrt 1562
Up_sqrtn_ram 668
Z2_sqrt 107647
Z_to_padic 260014
Zn_sqrt 360
Zp_teichmuller 9231
_mul 3656891
_muli 22062309
_mulr 6075619
_one 433633
_oner 12117
_rpowuu_msqr 493121
_rpowuu_sqr 1270651
_sqr 5063120
_sqri 59770950
_sqrr 13862119
abpq_init 4670753
abpq_sum 66516291
agm 96133
agm1 96375
agm1cx 330363
agm1r_abs 762640
agmcx_a_b 355005
agmcx_gap 5447989
agmcx_init 355005
agmr_gap 11161291
catalan 11
constcatalan 11
consteuler 48783
constlog2 23965235
constpi 37709561
cos_p 36
cubic_prec_mask 1521888
cxexp 3550769
cxexpm1 16642
cxlog1p 10
dvdsi_quot 1962
ellE 18
ellK 114
ellK_i 120
exp1r_abs 15240613
expIr 773761
expQ 1052507
expm1_Ir 16595
gcos 125438
gcotan 3599
gexp 14944132
gexpm1 22429
glog 15396801
glog1p 85
gpow 16768929
gpow0 92
gpowers 433638
gpowers0 178799
gpowg0 2125573
gpowgs 105419236
grootsof1 1037169
grootsof1_4 857294
gsin 979472
gsinc 1988180
gsincos 3558605
gsqrpowers 33903
gsqrt 54549097
gsqrtn 39005
gtan 164
is_ext_qfr 35
log1p_i 95
log2_split 3252
logagmcx 298317
logagmr_abs 698477
logr_abs 11697432
logr_aux 10281791
magm 12
magm_gap 72
modlog2 15249054
mpaut 12770124
mpcatalan 11
mpcos 1975580
mpcosm1 13995973
mpcotan 57
mpeuler 48783
mpexp 15301483
mpexp0 126284
mpexp_basecase 15175199
mpexpm1 20709
mplog 160162
mplog1p 45
mplog2 23965235
mppi 37709552
mpsin 622694
mpsinc 1988098
mpsincos 11402393
mpsincosm1 16595
mptan 97
mulii3 161425768
mulpowu 1128825
pari_close_floats 1499
pari_init_floats 1499
pi_ramanujan 2823
pow2Pis 10606
powPis 10300
pow_monome 538368
pow_polmod 20084
powcx 4729969
powcx_prec 163908
powersr 12117
powfrac 9053549
powgi 89345398
powis 23341076
powiu 90962511
powiu_sign 91055254
powp 136
powps 1128770
powr0 18145
powrfrac 377
powrs 4312231
powrshalf 0
powru 5251183
powruhalf 103272
powuu 40509068
real_I 26
rootsof1_cx 4336
rootsof1pow 13037544
rootsof1powinit 32544
rootsof1q_cx 25524
rootsof1u_cx 1886045
rpowuu 334076
scalarpol_get_1 312545
ser_agm1 17
ser_cmp_expo 42
ser_pow 6947
ser_pow_1 6872
ser_powfrac 6888
serchop 30
serchop0 33002
serchop_i 30
serexp 73031
shiftc_inplace 104358
sin_p 46
sqrt_ser 16029
sqrtnint 22212
sqrtnof1 497509
sqrtnr_abs 2398334
swap_clone 6490
tan_huge_im 3436
teich 4732
teichmuller 4935
teichmullerinit 1050
tofp_safe 9689
trans_eval 3402203
trans_evalgen 1663
transvec 1759875
transvecgen 280
upowers 8478
upowuu 89011177
usqrtn 6881
usqru 17553774
val_from_i 6882
zellagmcx 24642

Generated by: LCOV version 1.16