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 30604-e5d817ee12) Lines: 683 719 95.0 %
Date: 2026-01-08 09:21:40 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115531685
absdiviu_rem 51269200
addiispec 3332720462
adduispec 2789527794
adduispec_offset 765045801
addumului 0
affir 405106055
cmpiispec 3974776225
convi 439789
diviiexact 534443496
divis 323942
divis_rem 86373177
diviuexact 31784286
diviuexact_i 413554891
diviuuexact 200505
divri 151794863
divri_with_gmp 35478901
divrr 142534449
divrr_with_gmp 76247773
dvmdii 2192373748
equaliispec 267838593
floorr 6945682
icopy_ef 41522049
incloop 103814637
incneg 66684
incpos 103412320
int_normalize 308712537
mantissa2nr 138661938
mpz2GEN 57767120
muliispec 5836954970
muliispec_mirror 83187957
muluispec 5605794816
muluui 222741
pari_gmp_free 1762892
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34357702
remi2n 38104189
resetloop 174328
roundr_up_ip 518914262
setloop 2999294
shiftispec 714134296
sqrispec 1023974310
sqrispec_mirror 40103307
sqrtr_abs 126374384
sqrtremi 5128713
subiispec 3017058914
subiuspec 1778616863
truncr 3458821
umodiu 1330896663
xmpn_copy 6836488
xmpn_mirror 585475263
xmpn_mirrorcopy 715008022
xmpn_zero 237904954

Generated by: LCOV version 1.16