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 30733-eb2d773d38) Lines: 683 719 95.0 %
Date: 2026-03-03 09:24:12 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 1084
pari_kernel_init 1092
incneg 66684
resetloop 174328
diviuuexact 200563
muluui 222785
divis 323965
convi 440678
pari_gmp_free 1762633
setloop 2999286
truncr 3444432
sqrtremi 5129541
xmpn_copy 6854444
floorr 6941552
diviuexact 34097516
red_montgomery 34478030
divri_with_gmp 35480545
remi2n 38031602
sqrispec_mirror 40109608
icopy_ef 41510091
absdiviu_rem 51320309
mpz2GEN 57777250
divrr_with_gmp 76234806
muliispec_mirror 83262516
incpos 87358895
incloop 87764397
divis_rem 94054658
GEN2mpz 115552435
sqrtr_abs 126390062
mantissa2nr 138702921
divrr 142540446
divri 151795941
xmpn_zero 237954906
equaliispec 266948896
int_normalize 309129480
affir 405415058
diviuexact_i 430936378
roundr_up_ip 528675131
diviiexact 550201399
xmpn_mirror 586049794
xmpn_mirrorcopy 715455883
shiftispec 737970847
adduispec_offset 764912260
sqrispec 1098507211
umodiu 1344221172
subiuspec 1814948315
dvmdii 2213179937
adduispec 2831021960
subiispec 3057765010
addiispec 3375348415
cmpiispec 4012359964
muluispec 5693433050
muliispec 5923862106

Generated by: LCOV version 1.16