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 30734-f1f26dedcb) Lines: 683 719 95.0 %
Date: 2026-03-05 09:24:39 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 1084
pari_kernel_init 1092
incneg 66684
resetloop 174328
diviuuexact 200582
muluui 222792
divis 323967
convi 440672
pari_gmp_free 1762623
setloop 2999281
truncr 3441061
sqrtremi 5129506
xmpn_copy 6854554
floorr 6940382
diviuexact 34098695
red_montgomery 34499202
divri_with_gmp 35481479
remi2n 38007818
sqrispec_mirror 40107055
icopy_ef 41508102
absdiviu_rem 51329590
mpz2GEN 57776242
divrr_with_gmp 76238059
muliispec_mirror 83363968
incpos 87133285
incloop 87539715
divis_rem 94076832
GEN2mpz 115550559
sqrtr_abs 126395338
mantissa2nr 138708022
divrr 142558314
divri 151799896
xmpn_zero 237948598
equaliispec 266940694
int_normalize 308920114
affir 405463004
diviuexact_i 430997648
roundr_up_ip 528935625
diviiexact 550293262
xmpn_mirror 586256449
xmpn_mirrorcopy 715502939
shiftispec 737944589
adduispec_offset 765090265
sqrispec 1131545766
umodiu 1346659709
subiuspec 1815378924
dvmdii 2212962150
adduispec 2834078445
subiispec 3058697069
addiispec 3376433827
cmpiispec 4012984100
muluispec 5696748447
muliispec 5926837413

Generated by: LCOV version 1.16