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
GEN2mpz 115556810
absdiviu_rem 51263744
addiispec 3333377027
adduispec 2789720926
adduispec_offset 766026302
addumului 0
affir 405459445
cmpiispec 3974691216
convi 439946
diviiexact 534606471
divis 323956
divis_rem 86397282
diviuexact 31788111
diviuexact_i 413702337
diviuuexact 200502
divri 151796448
divri_with_gmp 35478801
divrr 142571934
divrr_with_gmp 76251341
dvmdii 2196496794
equaliispec 267757988
floorr 6946898
icopy_ef 41528805
incloop 103897203
incneg 66684
incpos 103491799
int_normalize 308885339
mantissa2nr 138688044
mpz2GEN 57779538
muliispec 5835371444
muliispec_mirror 83367720
muluispec 5606535305
muluui 222733
pari_gmp_free 1763120
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34403908
remi2n 38065989
resetloop 174328
roundr_up_ip 519506207
setloop 2999283
shiftispec 714929275
sqrispec 1025599729
sqrispec_mirror 40100490
sqrtr_abs 126390373
sqrtremi 5128804
subiispec 3015873280
subiuspec 1776963177
truncr 3459982
umodiu 1330438058
xmpn_copy 6836507
xmpn_mirror 586289345
xmpn_mirrorcopy 715477162
xmpn_zero 237951392

Generated by: LCOV version 1.16