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 30672-116f3d5b0e) Lines: 683 719 95.0 %
Date: 2026-02-06 09:23:51 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 200528
muluui 222751
divis 323962
convi 439919
pari_gmp_free 1763121
setloop 2999287
truncr 3437073
sqrtremi 5128776
xmpn_copy 6836289
floorr 6939134
diviuexact 31792465
red_montgomery 34419121
divri_with_gmp 35479006
remi2n 38045091
sqrispec_mirror 40101402
icopy_ef 41520382
absdiviu_rem 51276455
mpz2GEN 57782439
divrr_with_gmp 76230734
muliispec_mirror 83323826
divis_rem 86358242
incpos 102022970
incloop 102423147
GEN2mpz 115562875
sqrtr_abs 126380134
mantissa2nr 138667962
divrr 142529204
divri 151788224
xmpn_zero 237905256
equaliispec 267845328
int_normalize 308552531
affir 405293849
diviuexact_i 413886808
roundr_up_ip 519436241
diviiexact 534751318
xmpn_mirror 586064903
shiftispec 714911931
xmpn_mirrorcopy 715292736
adduispec_offset 765859538
sqrispec 1025524750
umodiu 1331436782
subiuspec 1777391665
dvmdii 2196582826
adduispec 2790942046
subiispec 3016152253
addiispec 3333886124
cmpiispec 3973777803
muluispec 5606794660
muliispec 5835089826

Generated by: LCOV version 1.16