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

Generated by: LCOV version 1.16