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 30107-5d3c5ac62a) Lines: 1886 2010 93.8 %
Date: 2025-04-01 09:20:36 Functions: 103 103 100.0 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Leading_is_neg 57792491
Q_to_Fp 226838
Qdivii 140094109
Qdivis 1583913
Qdiviu 141433968
Zp_nosquare_m1 42
_serprec 7161978
addQp 4762869
addRc 303962518
addRq 1274
addTp 7
add_intmod_same 3550208
add_rfrac 3018187
add_rfrac_scal 8811947
add_scal 44619090
add_ser_scal 408094
addqf 77
addsub_frac 41396936
addsub_frac_i 13628302
addsub_polmod 7203
addsub_polmod_scal 13420723
addsub_pp 19968044
conj_i 19578006
conjvec 84
divRc 2358223
divTp 3660
div_T_scal 6726454
div_intmod_same 341982
div_polmod_same 37093
div_rfrac 1187237
div_rfrac_pol 262344
div_rfrac_scal 32139
div_scal_T 9280992
div_scal_pol 9274198
div_scal_rfrac 37767
div_scal_ser 18550
div_ser 771510
div_ser_scal 1338593
divcR 23127990
divfq 42
divpT 1204910
divpp 13212334
divqf 63
divrunextu 224330455
fill_ser 5693888
fix_rfrac 207774
gadd 6075414580
gaddsg 270602888
gconj 133221
gdiv 433977810
gdivgs 12965949
gdivgu 54716982
gdivgunextu 1036796
ginv 36371780
gmul 8756782104
gmul2n 133221823
gmulsg 229732143
gmulug 124340566
gred_rfrac2 44823313
gred_rfrac_simple 57796671
gsqr 1175197558
gsub 2848139078
gsubsg 3168040
init_ser 5706235
inv_polmod 209967
is_ext_qfr 98
kro_quad 28
mkpadic_mod 24588701
mulRc 351337122
mulRc_direct 49
mulRq 2310
mulTp 4982881
mul_gen_rfrac 161432
mul_intmod_same 2835796
mul_polmod 2674917
mul_polmod_same 8565249
mul_polmod_scal 3428781
mul_rfrac 7910285
mul_rfrac_scal 10455276
mul_scal 150356613
mul_self_scal 7461000
mul_ser_scal 316204
mulcIR 11665867
mulcc 273973568
mulcxI 15648383
mulcxmI 3079004
mulcxpowIs 5523762
mulpp 17503129
mulqf 28
mulqq 1106
mulrfrac 37586925
quad_polmod_conj 18340
quad_polmod_mul 5860762
quad_polmod_norm 18340
rfrac_denom_mul_scal 9959428
ser_add 3581388
ser_normalize 7658
setfrac 14437053
sqr_polmod 484275
sqr_ser_part 112731
sub_intmod_same 1053721
transtype 154420315
warn_coercion 105

Generated by: LCOV version 1.16