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 - kernel/gmp - mp.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30862-ea47bd413c) Lines: 683 719 95.0 %
Date: 2026-05-05 09:26:54 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addumului 0
pari_gmp_realloc 0
pari_kernel_version 4
pari_kernel_close 1092
pari_kernel_init 1100
incneg 66684
resetloop 174380
diviuuexact 200734
muluui 222946
divis 336606
convi 442467
pari_gmp_free 1763839
setloop 2999305
truncr 3476922
sqrtremi 5131597
xmpn_copy 6873382
floorr 6950670
diviuexact 34028798
red_montgomery 34591951
divri_with_gmp 35547704
remi2n 37884360
sqrispec_mirror 40088639
icopy_ef 42099692
absdiviu_rem 51864294
mpz2GEN 57963200
divrr_with_gmp 78324893
muliispec_mirror 83284422
incpos 87491124
incloop 87899227
divis_rem 94098102
GEN2mpz 115923715
sqrtr_abs 130567983
mantissa2nr 141030775
divrr 151302347
divri 152788483
xmpn_zero 244156241
equaliispec 308644098
int_normalize 310329884
affir 406643251
diviuexact_i 433926406
roundr_up_ip 536047459
diviiexact 553724788
xmpn_mirror 589214027
xmpn_mirrorcopy 727193685
shiftispec 739835490
adduispec_offset 765524065
sqrispec 1142981227
umodiu 1360666137
subiuspec 1822778608
dvmdii 2254008041
adduispec 2835227707
subiispec 3100684415
addiispec 3380185284
cmpiispec 4042882248
muluispec 5689339254
muliispec 5951433638

Generated by: LCOV version 1.16