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 30674-be81ecfdd4) Lines: 683 719 95.0 %
Date: 2026-02-13 09:23:38 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 200502
muluui 222733
divis 323956
convi 439946
pari_gmp_free 1763120
setloop 2999283
truncr 3459982
sqrtremi 5128804
xmpn_copy 6836507
floorr 6946898
diviuexact 31788111
red_montgomery 34403908
divri_with_gmp 35478801
remi2n 38065989
sqrispec_mirror 40100490
icopy_ef 41528805
absdiviu_rem 51263744
mpz2GEN 57779538
divrr_with_gmp 76251341
muliispec_mirror 83367720
divis_rem 86397282
incpos 103491799
incloop 103897203
GEN2mpz 115556810
sqrtr_abs 126390373
mantissa2nr 138688044
divrr 142571934
divri 151796448
xmpn_zero 237951392
equaliispec 267757988
int_normalize 308885339
affir 405459445
diviuexact_i 413702337
roundr_up_ip 519506207
diviiexact 534606471
xmpn_mirror 586289345
shiftispec 714929275
xmpn_mirrorcopy 715477162
adduispec_offset 766026302
sqrispec 1025599729
umodiu 1330438058
subiuspec 1776963177
dvmdii 2196496794
adduispec 2789720926
subiispec 3015873280
addiispec 3333377027
cmpiispec 3974691216
muluispec 5606535305
muliispec 5835371444

Generated by: LCOV version 1.16