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
GEN2mpz 115562875
absdiviu_rem 51276455
addiispec 3333886124
adduispec 2790942046
adduispec_offset 765859538
addumului 0
affir 405293849
cmpiispec 3973777803
convi 439919
diviiexact 534751318
divis 323962
divis_rem 86358242
diviuexact 31792465
diviuexact_i 413886808
diviuuexact 200528
divri 151788224
divri_with_gmp 35479006
divrr 142529204
divrr_with_gmp 76230734
dvmdii 2196582826
equaliispec 267845328
floorr 6939134
icopy_ef 41520382
incloop 102423147
incneg 66684
incpos 102022970
int_normalize 308552531
mantissa2nr 138667962
mpz2GEN 57782439
muliispec 5835089826
muliispec_mirror 83323826
muluispec 5606794660
muluui 222751
pari_gmp_free 1763121
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34419121
remi2n 38045091
resetloop 174328
roundr_up_ip 519436241
setloop 2999287
shiftispec 714911931
sqrispec 1025524750
sqrispec_mirror 40101402
sqrtr_abs 126380134
sqrtremi 5128776
subiispec 3016152253
subiuspec 1777391665
truncr 3437073
umodiu 1331436782
xmpn_copy 6836289
xmpn_mirror 586064903
xmpn_mirrorcopy 715292736
xmpn_zero 237905256

Generated by: LCOV version 1.16