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 30657-d14c2a9e4e) Lines: 683 719 95.0 %
Date: 2026-01-29 09:23:20 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 1104
pari_kernel_init 1112
incneg 66684
resetloop 174328
diviuuexact 200544
muluui 222746
divis 323930
convi 439874
pari_gmp_free 1763111
setloop 2999292
truncr 3457835
sqrtremi 5128674
xmpn_copy 6836574
floorr 6944310
diviuexact 31785000
red_montgomery 34330042
divri_with_gmp 35477868
remi2n 38010283
sqrispec_mirror 40090846
icopy_ef 41523087
absdiviu_rem 51270162
mpz2GEN 57770913
divrr_with_gmp 76242356
muliispec_mirror 83284015
divis_rem 86373050
incpos 103276875
incloop 103682940
GEN2mpz 115539891
sqrtr_abs 126375385
mantissa2nr 138657318
divrr 142540789
divri 151792078
xmpn_zero 237893137
equaliispec 267841808
int_normalize 308898982
affir 405166381
diviuexact_i 413680086
roundr_up_ip 519319503
diviiexact 534555525
xmpn_mirror 585776939
shiftispec 714160403
xmpn_mirrorcopy 715058880
adduispec_offset 765385378
sqrispec 1024012233
umodiu 1330021979
subiuspec 1775717610
dvmdii 2193008674
adduispec 2787559495
subiispec 3011875191
addiispec 3330633286
cmpiispec 3969239140
muluispec 5597903086
muliispec 5828766084

Generated by: LCOV version 1.16