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 30658-0716cf3506) Lines: 683 719 95.0 %
Date: 2026-01-31 09:22:40 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 200455
muluui 222696
divis 323944
convi 439878
pari_gmp_free 1763120
setloop 2999291
truncr 3463864
sqrtremi 5128890
xmpn_copy 6836594
floorr 6948316
diviuexact 31781882
red_montgomery 34217301
divri_with_gmp 35478875
remi2n 38071062
sqrispec_mirror 40099808
icopy_ef 41527040
absdiviu_rem 51274362
mpz2GEN 57771820
divrr_with_gmp 76252917
muliispec_mirror 83405590
divis_rem 86371067
incpos 103287665
incloop 103695464
GEN2mpz 115541312
sqrtr_abs 126383328
mantissa2nr 138671490
divrr 142558328
divri 151795478
xmpn_zero 237912430
equaliispec 267839807
int_normalize 308810948
affir 405486938
diviuexact_i 413759911
roundr_up_ip 519317804
diviiexact 534642961
xmpn_mirror 586292136
shiftispec 714458660
xmpn_mirrorcopy 715474266
adduispec_offset 765728197
sqrispec 1024678715
umodiu 1328139617
subiuspec 1776161345
dvmdii 2194068422
adduispec 2786863506
subiispec 3013362570
addiispec 3331094500
cmpiispec 3971243845
muluispec 5592560565
muliispec 5823655327

Generated by: LCOV version 1.16