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 30762-238ab8e6c0) Lines: 2195 2260 97.1 %
Date: 2026-03-22 09:27:12 Functions: 168 169 99.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Pi2n 30102915
PiI2 267723
PiI2n 303430
Qp_exp 109082
Qp_exp_prec 98
Qp_exp_safe 109544
Qp_log 196253
Qp_sqrt 1862
Qp_sqrtn 2534
T2 43125239
Up_sqrt 1834
Up_sqrtn_ram 784
Z2_sqrt 149450
Z_to_padic 304175
Zn_sqrt 420
Zp_teichmuller 10815
_mul 4344224
_muli 30020590
_mulr 7175542
_one 527191
_oner 14196
_rpowuu_msqr 629864
_rpowuu_sqr 1622569
_sqr 6079205
_sqri 81941017
_sqrr 16350007
abpq_init 5586704
abpq_sum 81253756
agm 112196
agm1 112490
agm1cx 339262
agm1r_abs 1119024
agmcx_a_b 368011
agmcx_gap 5576646
agmcx_init 368011
agmr_gap 16560921
catalan 14
constcatalan 14
consteuler 59144
constlog2 30195772
constpi 46583246
cos_p 49
cubic_prec_mask 1770291
cxexp 4202034
cxexpm1 20298
cxlog1p 14
dvdsi_quot 2296
ellE 21
ellK 140
ellK_i 147
exp1r_abs 19970855
expIr 918560
expQ 1468924
expm1_Ir 20242
gcos 154874
gcotan 4214
gexp 19230660
gexpm1 27108
glog 18272587
glog1p 119
gpow 22525225
gpow0 126
gpowers 527196
gpowers0 802656
gpowg0 2513788
gpowgs 127105017
grootsof1 1218940
grootsof1_4 1008503
gsin 1253963
gsinc 2319562
gsincos 4211289
gsqrpowers 39568
gsqrt 68868163
gsqrtn 45775
gtan 224
is_ext_qfr 49
log1p_i 133
log2_split 43750
logagmcx 301875
logagmr_abs 1044122
logr_abs 14015648
logr_aux 12120932
magm 14
magm_gap 84
modlog2 19987242
mpaut 15254457
mpcatalan 14
mpcos 2745434
mpcosm1 16958005
mpcotan 70
mpeuler 59144
mpexp 20040795
mpexp0 147547
mpexp_basecase 19893303
mpexpm1 25117
mplog 203680
mplog1p 413
mplog2 30195656
mppi 46583197
mpsin 836787
mpsinc 2319450
mpsincos 13380913
mpsincosm1 20242
mptan 133
mulii3 191432717
mulpowu 1317031
pari_close_floats 373183
pari_init_floats 374568
pi_ramanujan 42810
pow2Pis 12978
powPis 12383
pow_monome 640046
pow_polmod 23767
powcx 5521729
powcx_prec 192882
powersr 14196
powfrac 11868226
powgi 107796314
powis 29116393
powiu 115767533
powiu_sign 115976009
powp 161
powps 1316971
powr0 21385
powrfrac 518
powrs 5102615
powrshalf 0
powru 6160430
powruhalf 121350
powuu 47394357
real_I 35
rootsof1_cx 5684
rootsof1pow 15210468
rootsof1powinit 37968
rootsof1q_cx 29778
rootsof1u_cx 2217802
rpowuu 446347
scalarpol_get_1 377470
ser_agm1 21
ser_cmp_expo 49
ser_pow 8127
ser_pow_1 8022
ser_powfrac 8043
serchop 42
serchop0 41398
serchop_i 42
serexp 89075
shiftc_inplace 120675
sin_p 63
sqrt_ser 18739
sqrtnint 27178
sqrtnof1 589020
sqrtnr_abs 2815006
swap_clone 87100
tan_huge_im 4018
teich 5565
teichmuller 5803
teichmullerinit 1225
tofp_safe 13255
trans_eval 4029350
trans_evalgen 1967
transvec 2082922
transvecgen 329
upowers 12017
upowuu 111797211
usqrtn 8555
usqru 22260388
val_from_i 8036
zellagmcx 28749

Generated by: LCOV version 1.16