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-07 09:23:42 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 200515
muluui 222751
divis 323949
convi 439920
pari_gmp_free 1763113
setloop 2999290
truncr 3439037
sqrtremi 5128802
xmpn_copy 6836334
floorr 6938593
diviuexact 31786207
red_montgomery 34423579
divri_with_gmp 35478644
remi2n 37898066
sqrispec_mirror 40102144
icopy_ef 41523942
absdiviu_rem 51270463
mpz2GEN 57778474
divrr_with_gmp 76230919
muliispec_mirror 83438770
divis_rem 86347477
incpos 103347402
incloop 103747596
GEN2mpz 115555068
sqrtr_abs 126381853
mantissa2nr 138671964
divrr 142534116
divri 151788219
xmpn_zero 237909558
equaliispec 267848836
int_normalize 308713696
affir 405427696
diviuexact_i 413380760
roundr_up_ip 519343291
diviiexact 534295211
xmpn_mirror 586221990
shiftispec 714208400
xmpn_mirrorcopy 715456058
adduispec_offset 765650506
sqrispec 1024442113
umodiu 1328095027
subiuspec 1776538429
dvmdii 2193801621
adduispec 2786545549
subiispec 3013222457
addiispec 3332227311
cmpiispec 3970433156
muluispec 5603831439
muliispec 5832192658

Generated by: LCOV version 1.16